Ubuntu18.04.1 64位
https://github.com/iview/iview-admin
git clone https://github.com/iview/iview-admin.git
npm install
执行完成,无致命错误
报error错误,命令执行未完成,报错如下:
root@ubuntu:/home/tmp/iview-admin# npm install
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
> [email protected] install /home/tmp/iview-admin/node_modules/nodent-runtime
> node build.js
fs.js:114
throw err;
^
Error: EACCES: permission denied, open '/home/tmp/iview-admin/node_modules/nodent-runtime/dist/index.js'
at Object.openSync (fs.js:438:3)
at Object.writeFileSync (fs.js:1189:35)
at Object.<anonymous> (/home/tmp/iview-admin/node_modules/nodent-runtime/build.js:5:4)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
npm WARN [email protected] requires a peer of eslint@>=5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-node@>=7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-promise@>=4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-standard@>=4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-03-11T07_59_47_560Z-debug.log
已经是用root的权限了。
npm install,但实际上还不行,需要加sudo/xxx/xxx/bin加入环境变量中,但在Ubuntu下,此时因为系统安全限制,非/usr/bin或/usr/local/bin下的可执行文件,是没法使用sudo作为命令前缀的。node,npm的可执行文件放入/usr/bin或/usr/local/bin下。以这种方法安装的node和npm,是可以使用sudo npm install执行成功
Most helpful comment
npm install,但实际上还不行,需要加sudo/xxx/xxx/bin加入环境变量中,但在Ubuntu下,此时因为系统安全限制,非/usr/bin或/usr/local/bin下的可执行文件,是没法使用sudo作为命令前缀的。node,npm的可执行文件放入/usr/bin或/usr/local/bin下。以这种方法安装的node和npm,是可以使用sudo npm install执行成功