docs icon indicating copy to clipboard operation
docs copied to clipboard

[Linux] 执行 npm run compile 报错

Open keleyundou opened this issue 7 years ago • 1 comments

> node build/scripts/compile

module.js:545
    throw err;
    ^

Error: Cannot find module 'fs-extra'
    at Function.Module._resolveFilename (module.js:543:15)
    at Function.Module._load (module.js:470:25)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/colabean/Desktop/workspace/flow-web/build/scripts/compile.js:1:74)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] compile: `node build/scripts/compile`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

手动执行 npm install fs-extra 还是不行

相关环境:

1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'compile' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'precompile', 'compile', 'postcompile' ]

keleyundou avatar Mar 23 '18 02:03 keleyundou

我也遇到同样的问题,

  1. rm -rf /node_modules
  2. npm install fs-extra -S //不要全局安装

这样就可以编译过了

xueerfei avatar Jul 09 '18 08:07 xueerfei