0
我有我已經安裝了NVM類似的WebPack使用正確的節點版本
SHELL:=/bin/bash --login
PROJECT_NAME = Webapp
PROJECT_URL = https://github.com/nkhine/myapp
# Name variables
BUILD_ASSETS = $(wildcard ./build/*.*)
dev: node_modules
GIT_DESCRIBE=`git describe --long --tags --dirty --always` \
nvm exec node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev.config.js
我的開發機器上生成文件,並似乎都正常工作
但是當我運行
$ make dev
GIT_DESCRIBE=`git describe --long --tags --dirty --always` \
nvm exec node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev.config.js
Running node v6.2.0 (npm v3.8.9)
然後我得到
[975] ./~/style-loader/addStyles.js 7.15 kB {1} [built]
+ 3 hidden modules
ERROR in Missing binding /home/khine/Sandboxes/webapp/node_modules/node-sass/vendor/linux-x64-48/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 6.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 4.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.
@ ./~/styleguide/src/styles/styles.scss 4:14-715 13:2-17:4 14:20-721
如何強制webpack使用nvm版本的節點?
運行node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev.config.js
工作正常