Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 节点sass安装问题与vagrant box_Node.js_Npm_Vagrant_Node Sass - Fatal编程技术网

Node.js 节点sass安装问题与vagrant box

Node.js 节点sass安装问题与vagrant box,node.js,npm,vagrant,node-sass,Node.js,Npm,Vagrant,Node Sass,我正试图在我的vagrant box中运行npm install,但出现以下错误: node-sass@4.1.1 install /vagrant/MyStrainGuide/client/node_modules/node-sass > node scripts/install.js /vagrant/MyStrainGuide/client/node_modules/boom/lib/index.js:146 for (i = 0, il = wwwArray.le

我正试图在我的vagrant box中运行
npm install
,但出现以下错误:

node-sass@4.1.1 install /vagrant/MyStrainGuide/client/node_modules/node-sass
> node scripts/install.js

/vagrant/MyStrainGuide/client/node_modules/boom/lib/index.js:146
        for (i = 0, il = wwwArray.length; i < il; ++

SyntaxError: Invalid or unexpected token
    at Object.exports.runInThisContext (vm.js:78:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/vagrant/MyStrainGuide/client/node_modules/hawk/lib/index.js:3:33)
    at Module._compile (module.js:571:32)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN react-markdown-area@0.3.8 requires a peer of react@^0.14.5 but none was installed.
npm WARN react-markdown-area@0.3.8 requires a peer of react-dom@^0.14.5 but none was installed.
npm WARN react-webpack-rails-tutorial@0.0.1 No description
npm WARN react-webpack-rails-tutorial@0.0.1 No repository field.
npm WARN react-webpack-rails-tutorial@0.0.1 No license field.
npm WARN ETXTBSY: text file is busy, rmdir '/vagrant/MyStrainGuide/client/node_modules/dashdash/node_modules'
npm ERR! Linux 3.13.0-105-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v7.4.0/bin/node" "/home/vagrant/.nvm/versions/node/v7.4.0/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE

npm ERR! node-sass@4.1.1 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.1.1 install script 'node scripts/install.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 scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, 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!     /vagrant/MyStrainGuide/client/npm-debug.log

我假设这是因为npm安装没有正确完成。我以前从未遇到过这个问题。这是我设置的一个新盒子。

我也为这个问题挣扎了很长一段时间。我可以用这里的建议来解决这个问题-

向下滚动到最后的第二条注释,然后按照这些步骤将您的node_modules文件夹移出共享文件夹,这将为您修复所有问题

为了方便起见,这里是评论

直接在共享文件夹中安装节点包时存在一些问题。一个好的解决方法是在vm内部的某个地方安装软件包,然后创建一个符号链接。
例:
cd/流浪汉
rm-射频节点单元模块
mkdir/home/vagrant/vagrant_节点_模块
cp package.json/home/vagrant/vagrant_节点_模块
cd/home/vagrant/vagrant_节点_模块
npm安装
cd/流浪汉
ln-s/home/vagrant/vagrant_节点_模块/节点_模块节点_模块
ls-ld节点单元


谢谢,这很有效!老实说,我只是过渡到使用纱线。真的没有理由再使用npm了。
02:35:31 client.1 | > webpack -w --config webpack.config.js --watch-poll
02:35:31 client.1 |
02:35:32 client.1 | /vagrant/MyStrainGuide/client/node_modules/enhanced-resolve/lib/node.js:60
02:35:32 client.1 | module.exports.sync = function resolveSync(context,
02:35:32 client.1 |
02:35:32 client.1 | SyntaxError: Invalid or unexpected token
02:35:32 client.1 |     at Object.exports.runInThisContext (vm.js:78:16)
02:35:32 client.1 |     at Module._compile (module.js:543:28)
02:35:32 client.1 |     at Object.Module._extensions..js (module.js:580:10)
02:35:32 client.1 |     at Module.load (module.js:488:32)
02:35:32 client.1 |     at tryModuleLoad (module.js:447:12)
02:35:32 client.1 |     at Function.Module._load (module.js:439:3)
02:35:32 client.1 |     at Module.require (module.js:498:17)
02:35:32 client.1 |     at require (internal/module.js:20:19)
02:35:32 client.1 |     at Object.<anonymous> (/vagrant/MyStrainGuide/client/node_modules/webpack/bin/convert-argv.js:4:15)
02:35:32 client.1 |     at Module._compile (module.js:571:32)
02:35:32 client.1 |
02:35:32 client.1 | npm ERR! Linux 3.13.0-105-generic
02:35:32 client.1 | npm ERR! argv "/home/vagrant/.nvm/versions/node/v7.4.0/bin/node" "/home/vagrant/.nvm/versions/node/v7.4.0/bin/npm" "run" "build:development"
02:35:32 client.1 | npm ERR! node v7.4.0
02:35:32 client.1 | npm ERR! npm  v4.0.5
02:35:32 client.1 | npm ERR! code ELIFECYCLE
02:35:32 client.1 | npm ERR! react-webpack-rails-tutorial@0.0.1 build:development: `webpack -w --config webpack.config.js --watch-poll`
02:35:32 client.1 | npm ERR! Exit status 1
02:35:32 client.1 | npm ERR!
02:35:32 client.1 | npm ERR! Failed at the react-webpack-rails-tutorial@0.0.1 build:development script 'webpack -w --config webpack.config.js --watch-poll'.
02:35:32 client.1 | npm ERR! Make sure you have the latest version of node.js and npm installed.
02:35:32 client.1 | npm ERR! If you do, this is most likely a problem with the react-webpack-rails-tutorial package,
02:35:32 client.1 | npm ERR! not with npm itself.
02:35:32 client.1 | npm ERR! Tell the author that this fails on your system:
02:35:32 client.1 | npm ERR!     webpack -w --config webpack.config.js --watch-poll
02:35:32 client.1 | npm ERR! You can get information on how to open an issue for this project with:
02:35:32 client.1 | npm ERR!     npm bugs react-webpack-rails-tutorial
02:35:32 client.1 | npm ERR! Or if that isn't available, you can get their info via:
02:35:32 client.1 | npm ERR!     npm owner ls react-webpack-rails-tutorial
02:35:32 client.1 | npm ERR! There is likely additional logging output above.
02:35:32 client.1 |
02:35:32 client.1 | npm ERR! Please include the following file with any support request:
02:35:32 client.1 | npm ERR!     /vagrant/MyStrainGuide/client/npm-debug.log
02:35:33 client.1 | exited with code 1
02:35:33 system   | sending SIGTERM to all processes
02:35:33 web.1    | terminated by SIGTERM