无法安装节点sass相关性

Cannot install node-sass dependancy

本文关键字:sass 相关性 节点 安装      更新时间:2023-09-26

我试图在从repo克隆的项目中安装所有依赖项,但在node-sass上失败了。我使用操作系统Ubuntu 14.04。这是我收到的错误日志:

node) child_process: options.customFds option is deprecated. Use options.stdio instead.
make: Entering directory `/home/maras/Documents/eCodile/debtorcare/client/node_modules/gulp-sass/node_modules/node-sass/build'
  CXX(target) Release/obj.target/binding/binding.o
In file included from ../binding.cpp:7:0:
../sass_context_wrapper.h:10:3: error: ‘uv_work_t’ does not name a type
   uv_work_t request;
   ^
../sass_context_wrapper.h:20:3: error: ‘uv_work_t’ does not name a type
   uv_work_t request;
   ^
../binding.cpp:13:20: error: variable or field ‘WorkOnContext’ declared void
 void WorkOnContext(uv_work_t* req) {
                    ^
../binding.cpp:13:20: error: ‘uv_work_t’ was not declared in this scope
../binding.cpp:13:31: error: ‘req’ was not declared in this scope
 void WorkOnContext(uv_work_t* req) {
                               ^
../binding.cpp:19:22: error: variable or field ‘MakeOldCallback’ declared void
 void MakeOldCallback(uv_work_t* req) {
                      ^
../binding.cpp:19:22: error: ‘uv_work_t’ was not declared in this scope
../binding.cpp:19:33: error: ‘req’ was not declared in this scope
 void MakeOldCallback(uv_work_t* req) {
                                 ^
make: *** [Release/obj.target/binding/binding.o] Error 1
make: Leaving directory `/home/maras/Documents/eCodile/debtorcare/client/node_modules/gulp-sass/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/maras/.nvm/versions/node/v5.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-58-generic
gyp ERR! command "/home/maras/.nvm/versions/node/v5.5.0/bin/node" "/home/maras/.nvm/versions/node/v5.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/maras/Documents/eCodile/debtorcare/client/node_modules/gulp-sass/node_modules/node-sass
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
Build failed
Debtorcare@0.0.0 /home/maras/Documents/eCodile/debtorcare/client
├─┬ gulp-jade@0.3.0
│ └─┬ event-stream@3.0.20 
│   ├── map-stream@0.0.6 
│   └── split@0.2.10 
└─┬ gulp-uglify@0.1.0
  ├── clone@0.1.19 
  └─┬ event-stream@3.0.20 
    ├── map-stream@0.0.6 
    └── split@0.2.10 
npm WARN EPACKAGEJSON Debtorcare@0.0.0 No description
npm WARN EPACKAGEJSON Debtorcare@0.0.0 No repository field.
npm WARN EPACKAGEJSON Debtorcare@0.0.0 No license field.
npm ERR! Linux 3.19.0-58-generic
npm ERR! argv "/home/maras/.nvm/versions/node/v5.5.0/bin/node" "/home/maras/.nvm/versions/node/v5.5.0/bin/npm" "install"
npm ERR! node v5.5.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! node-sass@0.7.0 install: `node build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@0.7.0 install script 'node build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/maras/Documents/eCodile/debtorcare/client/npm-debug.log

我试图删除.node_modules文件,重新启动等,但没有成功。有人知道这里可能出了什么问题吗?

尝试使用以下命令安装节点sass。

sudo npm install--不安全的perm节点sass

我遇到了同样的错误,一直以来,我都在使用NVM维护多个版本的节点,我使用以下命令解决了这个问题,

使用以下命令清除缓存,

npm cache clear --force

使用安装节点sass依赖项

npm install --save-dev node-sass --unsafe-perm

重建节点sass,但仅在需要时,

npm rebuild node-sass --unsafe-perm

然后,我可以使我的构建成功。希望这能有所帮助。