在创建新的angular-7应用时出现权限拒绝错误。我在全球范围内安装了最新的angular CLI,没有任何问题。我正在使用Google云计算引擎
OS:Debian GNU / Linux 9(拉伸)
CPU:4
7.5GB内存
代码编辑器:我正在使用编码器https://coder.com/
这是我在使用ng new myapp
创建新的角度应用程序时遇到的错误
> node-sass@4.11.0 install /home/learncodemalayalam/Works/myapp/node_modules/node-sass
> node scripts/install.js
Unable to save binary /home/learncodemalayalam/Works/myapp/node_modules/node-sass/vendor/linux-x64-64 : { Error: EACCES: permission denied, mkdir '/home/learncodemalayalam/Works/myapp/node_modules/node-sass/vendor'
at Object.mkdirSync (fs.js:854:3)
at sync (/home/learncodemalayalam/Works/myapp/node_modules/mkdirp/index.js:71:13)
at Function.sync (/home/learncodemalayalam/Works/myapp/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/home/learncodemalayalam/Works/myapp/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/home/learncodemalayalam/Works/myapp/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (internal/modules/cjs/loader.js:743:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:755:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:592:12)
at Function.Module._load (internal/modules/cjs/loader.js:584:3)
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path:
'/home/learncodemalayalam/Works/myapp/node_modules/node-sass/vendor' }
> node-sass@4.11.0 postinstall /home/learncodemalayalam/Works/myapp/node_modules/node-sass
> node scripts/build.js
Building: /usr/bin/nsolid /home/learncodemalayalam/Works/myapp/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/nsolid',
gyp verb cli '/home/learncodemalayalam/Works/myapp/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.8.0
gyp info using node@10.15.2 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.13
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 10.15.2
gyp verb command install [ '10.15.2' ]
gyp verb install input version string "10.15.2"
gyp verb install installing version: nsolid-10.15.2
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/nsolid-10.15.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/learncodemalayalam/Works/myapp/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '--node_gyp_internal_noretry', '10.15.2' ]
gyp verb install input version string "10.15.2"
gyp verb install installing version: nsolid-10.15.2
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 10.15.2
gyp verb ensuring nodedir is created /home/learncodemalayalam/Works/myapp/node_modules/node-sass/.node-gyp/nsolid-10.15.2
gyp WARN install got an error, rolling back install
gyp verb command remove [ 'nsolid-10.15.2' ]
gyp verb remove using node-gyp dir: /home/learncodemalayalam/Works/myapp/node_modules/node-sass/.node-gyp
gyp verb remove removing target version: nsolid-10.15.2
gyp verb remove removing development files for version: nsolid-10.15.2
gyp WARN install got an error, rolling back install
gyp verb command remove [ 'nsolid-10.15.2' ]
gyp verb remove using node-gyp dir: /home/learncodemalayalam/Works/myapp/node_modules/node-sass/.node-gyp
gyp verb remove removing target version: nsolid-10.15.2
gyp verb remove removing development files for version: nsolid-10.15.2
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/learncodemalayalam/Works/myapp/node_modules/node-sass/.node-gyp'
gyp ERR! System Linux 4.9.0-9-amd64
gyp ERR! command "/usr/bin/nsolid" "/home/learncodemalayalam/Works/myapp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/learncodemalayalam/Works/myapp/node_modules/node-sass
gyp ERR! node -v v10.15.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.11.0 (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.11.0 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
added 1025 packages from 1012 contributors and audited 42611 packages in 29.601s
found 1 high severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details