Wednesday, 3 May 2017

How to install node_modules globally?

I'm trying to start nodejs on this project: WatchUsBuild-React

I'm able to run it by following the instructions in readme file, but it creates node_modules inside project folder and I don't to want it, I just want to use some kind of global installed module. I read a lot of questions and tutorial but I cannot figure it out. AmIi missing something? I tried to set Enviroment Variable to my nodejs folder installation or use npm install 'package' -g but still not working.

This is an error:

    (function (exports, require, module, __filename, __dirname) { import gulp from 'gulp';
                                                              ^^^^^^
SyntaxError: Unexpected token import
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    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 Liftoff.handleArguments (C:\Users\Lavoro\Desktop\watchusbuild-react\node_modules\gulp\bin\gulp.js:116:3)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Users\\Lavoro\\AppData\\Roaming\\npm\\node.exe" "C:\\Users\\Lavoro\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! babel-with-gulp@1.0.0 start: `gulp watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the babel-with-gulp@1.0.0 start script 'gulp watch'.
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 babel-with-gulp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp watch
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs babel-with-gulp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls babel-with-gulp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Lavoro\AppData\Roaming\npm-cache\_logs\2017-05-03T15_38_17_906Z-debug.log



via Valerio Marzulli

No comments:

Post a Comment