把一个vue项目拷贝到另一个地方启动不了的解决办法(Error: Cannot find module ‘’')

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_41557291/article/details/81561498

公司的项目拷贝到家里,是不是就启动不了了。虽然使用了cnpm install安装之后还是疯狂提示你缺少什么什么包,而且按照他的提示永远安装不完。就像下面这样

 

造成这样的原因是当你在一台电脑上编译后npm会有cache缓存,到另外一台电脑上编译这个项目的缓存与原缓存不一致,导致编译报错。

 

解决办法:

1. 删掉node_modules文件夹,

2 .执行 npm cache clean 或者  cnpm cache clean 命令清除掉cache缓存,

3.然后cnpm install 和npm run dev就可以在这台电脑运行你的项目

展开阅读全文

Error: Cannot find module '../build/Debug/nodegit.node'

02-05

Error: Cannot find module '../build/Debug/nodegit.node'rn at Function.Module._resolveFilename (module.js:538:15)rn at Function.Module._load (module.js:468:25)rn at Module.require (module.js:587:17)rn at require (internal/module.js:11:18)rn at Object. (/home/slave/doit2/node_modules/nodegit/dist/nodegit.js:18:12)rn at Module._compile (module.js:643:30)rn at Object.Module._extensions..js (module.js:654:10)rn at Module.load (module.js:556:32)rn at tryModuleLoad (module.js:499:12)rn at Function.Module._load (module.js:491:3)rn at Module.require (module.js:587:17)rn at require (internal/module.js:11:18)rn at Object. (/home/slave/doit2/app/controller/zookeeper.js:11:13)rn at Module._compile (module.js:643:30)rn at Object.Module._extensions..js (module.js:654:10)rn at Module.load (module.js:556:32) code: 'MODULE_NOT_FOUND' rnrn-------------如下rnrn[root@ doit2]# npm install nodegit -frnnpm WARN using --force I sure hope you know what you are doing.rnrn> nodegit@0.20.3 install /home/slave/doit2/node_modules/nodegitrn> node lifecycleScripts/preinstall && node lifecycleScripts/installrnrn[nodegit] Running pre-install scriptrn[nodegit] Configuring libssh2.rn Error: Command failed: /home/slave/doit2/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/slave/doit2/node_modules/nodegit/vendor/openssl/opensslrn/home/slave/doit2/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' optionrnTry `/home/slave/doit2/node_modules/nodegit/vendor/libssh2/missing --help' for more informationrnconfigure: WARNING: 'missing' script is too old or missingrnconfigure: error: No crypto library found!rnTry --with-libssl-prefix=PATHrn or --with-libgcrypt-prefix=PATHrn or --with-wincng on Windowsrnrn at ChildProcess.exithandler (child_process.js:275:12)rn at emitTwo (events.js:126:13)rn at ChildProcess.emit (events.js:214:7)rn at maybeClose (internal/child_process.js:925:16)rn at Socket.stream.socket.on (internal/child_process.js:346:11)rn at emitOne (events.js:116:13)rn at Socket.emit (events.js:211:7)rn at Pipe._handle.close [as _onclose] (net.js:554:12)rn killed: false,rn code: 1,rn signal: null,rn cmd: '/home/slave/doit2/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/slave/doit2/node_modules/nodegit/vendor/openssl/openssl' rn/home/slave/doit2/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' optionrnTry `/home/slave/doit2/node_modules/nodegit/vendor/libssh2/missing --help' for more informationrnconfigure: WARNING: 'missing' script is too old or missingrnconfigure: error: No crypto library found!rnTry --with-libssl-prefix=PATHrn or --with-libgcrypt-prefix=PATHrn or --with-wincng on Windowsrnrn[nodegit] ERROR - Could not finish preinstallrn Error: Command failed: /home/slave/doit2/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/slave/doit2/node_modules/nodegit/vendor/openssl/opensslrn/home/slave/doit2/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' optionrnTry `/home/slave/doit2/node_modules/nodegit/vendor/libssh2/missing --help' for more informationrnconfigure: WARNING: 'missing' script is too old or missingrnconfigure: error: No crypto library found!rnTry --with-libssl-prefix=PATHrn or --with-libgcrypt-prefix=PATHrn or --with-wincng on Windowsrnrn at ChildProcess.exithandler (child_process.js:275:12)rn at emitTwo (events.js:126:13)rn at ChildProcess.emit (events.js:214:7)rn at maybeClose (internal/child_process.js:925:16)rn at Socket.stream.socket.on (internal/child_process.js:346:11)rn at emitOne (events.js:116:13)rn at Socket.emit (events.js:211:7)rn at Pipe._handle.close [as _onclose] (net.js:554:12)rn killed: false,rn code: 1,rn signal: null,rn cmd: '/home/slave/doit2/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/slave/doit2/node_modules/nodegit/vendor/openssl/openssl' rnrn> nodegit@0.20.3 postinstall /home/slave/doit2/node_modules/nodegitrn> node lifecycleScripts/postinstallrnrn[nodegit] WARN - Could not finish postinstallrn Error: Command failed: node "/home/slave/doit2/node_modules/nodegit/dist/nodegit.js"rnmodule.js:540rn throw err;rn ^rnrnError: Cannot find module '../build/Debug/nodegit.node'rn at Function.Module._resolveFilename (module.js:538:15)rn at Function.Module._load (module.js:468:25)rn at Module.require (module.js:587:17)rn at require (internal/module.js:11:18)rn at Object. (/home/slave/doit2/node_modules/nodegit/dist/nodegit.js:18:12)rn at Module._compile (module.js:643:30)rn at Object.Module._extensions..js (module.js:654:10)rn at Module.load (module.js:556:32)rn at tryModuleLoad (module.js:499:12)rn at Function.Module._load (module.js:491:3)rnrn at ChildProcess.exithandler (child_process.js:275:12)rn at emitTwo (events.js:126:13)rn at ChildProcess.emit (events.js:214:7)rn at maybeClose (internal/child_process.js:925:16)rn at Socket.stream.socket.on (internal/child_process.js:346:11)rn at emitOne (events.js:116:13)rn at Socket.emit (events.js:211:7)rn at Pipe._handle.close [as _onclose] (net.js:554:12)rn killed: false,rn code: 1,rn signal: null,rn cmd: 'node "/home/slave/doit2/node_modules/nodegit/dist/nodegit.js"' rnnpm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.rnnpm WARN doit@1.0.0 No repository field.rnrn+ nodegit@0.20.3rnupdated 1 package in 35.139s 论坛

没有更多推荐了,返回首页