无法在我的 gulp 项目上安装 gulp-sass :(

无法在我的 gulp 项目上安装 gulp-sass :(

有人能帮帮我吗?

[email protected] install /home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass
node scripts/install.js

Unable to save binary /home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass/vendor/linux-x64-59 : { Error: EACCES: permission denied, mkdir '/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass/vendor'
    at Object.fs.mkdirSync (fs.js:905:18)
    at sync (/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass/scripts/install.js:114:11)
    at Object.<anonymous> (/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass/scripts/install.js:157:1)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass/vendor' }

[email protected] postinstall /home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass
node scripts/build.js

Building: /usr/local/bin/node /home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/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/local/bin/node',
gyp verb cli   '/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/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 [email protected]
gyp info using [email protected] | 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 platform; print(platform.python_version());"` returned: "2.7.12\n"
gyp verb get node dir no --target version specified, falling back to host node version: 9.0.0
gyp verb command install [ '9.0.0' ]
gyp verb install input version string "9.0.0"
gyp verb install installing version: 9.0.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 9.0.0
gyp verb build dir attempting to create "build" dir: /home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass/build
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass/build'
gyp ERR! System Linux 4.10.0-42-generic
gyp ERR! command "/usr/local/bin/node" "/home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/desarrollo/Escritorio/WORKSPACE/PROYECTOS/marcelotisot.com/sitio web/freelancer/node_modules/node-sass
gyp ERR! node -v v9.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall 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!     /home/desarrollo/.npm/_logs/2018-04-25T09_09_37_592Z-debug.log

答案1

存在访问错误。

因为它说mkdir无法执行系统调用。使用以下命令运行命令或使用命令sudo将安装文件夹的所有者更改为当前用户chown

答案2

按照https://github.com/angular/angular-cli/issues/6848-@jcicero518 的评论

运行sudo chown yourname:yourgroup node_modules其中yourname/yourgroup是所有其他非根控制文件的名称/组。

然后安装不带 gulp-sass sudo

相关内容