模块版本不匹配。预计46,得到48,节点

时间:2017-08-06 05:35:41

标签: node.js npm require

当我需要以下文件模块时

import numpy as np
import matplotlib.pyplot as plt
z=np.array([[ 2.08273679, -0.06591932, -1.14525488, -1.49923222, -1.74361248,
    -1.81418446, -1.90115591, -1.94329043, -1.93130228, -1.96064259],
   [ 0.20180514, -0.94522815, -1.34635828, -1.58844515, -1.7528935 ,
    -1.84438752, -1.86257547, -1.9439332 , -1.99009407, -1.94829146],
   [-1.09749238, -1.48234452, -1.64234357, -1.75344742, -1.83019763,
    -1.88547473, -1.92958533, -1.940775  , -1.95535063, -1.9629588 ],
   [-1.62892483, -1.70176401, -1.76263555, -1.84966414, -1.87139241,
    -1.91879916, -1.90796703, -1.96632612, -1.95794984, -1.94585536],
   [-1.71551518, -1.91806287, -1.86999609, -1.90800839, -1.92515012,
    -1.93386969, -1.96487487, -1.95405297, -1.97032435, -1.96087146],
   [-1.81904322, -1.94790171, -2.        , -1.96932249, -1.91842475,
    -1.98101775, -1.98521938, -1.97618539, -1.95892852, -2.01410874],
   [-1.8138236 , -1.90877811, -1.93966404, -1.98406259, -1.95253807,
    -1.95867436, -1.96679456, -2.01126218, -1.99885932, -1.99369292],
   [-1.9927308 , -1.97658099, -1.91586737, -1.96813381, -1.98416011,
    -1.98639893, -1.99997964, -1.99746813, -1.98126505, -1.97767361],
   [-1.96406473, -1.92609437, -1.99171257, -1.94687523, -1.9823819 ,
    -1.97786533, -2.02323228, -1.98559114, -1.99172681, -2.00881064],
   [-1.92470024, -1.99537152, -1.99419303, -1.97261023, -1.9673841 ,
    -1.98801505, -2.02412735, -2.01394008, -2.01956817, -2.04963448]])
x=y=np.arange(0.002,0.022,0.002)
#The following gives the plot I currently have
plt.figure()
plt.contourf(x,y,z)
plt.show()
#Tried to flip the matrix z using np.flipud and np.fliplr
plt.figure()
plt.contourf(x,y,z)
plt.contourf(-x,y,np.fliplr(z))
plt.contourf(x,-y,np.flipud(z))
plt.contourf(-x,-y,np.flipud(np.fliplr(z)))
plt.show()
#Also tried to rotate the matrix z using np.rot90
plt.figure()
plt.contourf(x,y,z)
plt.contourf(x,-y,np.rot90(z))
plt.contourf(-x,-y,np.rot90(z,2))
plt.contourf(-x,y,np.rot90(z,3))
plt.show()

我在控制台中发现了一个错误。控制台中报告了以下错误:

const nodejieba = require('nodejieba');

在我的package.json文件中,nodejieba版本为 module.js:435 return process.dlopen(module, path._makeLong(filename)); ^ Error: Module version mismatch. Expected 46, got 48. at Error (native) at Object.Module._extensions..node (module.js:435:18) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object.<anonymous> (/home/electronDesktopTool/node_modules/nodejieba/index.js:1:79) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) Process finished with exit code 1 ,当我使用"nodejieba": "^2.2.4",时,没有错误

我曾尝试删除npm i nodejieba --save-dev文件夹和node_modules,但我仍然无法解决问题,而且我已尝试npm i而未解决它。请告诉我还有谁遇到过它

0 个答案:

没有答案