I want to install/use the Gulp-Plugin uncss (https://www.npmjs.com/package/gulp-un-css/) as my very first gulp-"try".
I therefore installed npm and Gulp successfully globally with the CLI version 3.9.1. I also installed the uncss-plugin with npm install gulp-uncss --save-dev and with sudo npm install gulp-uncss --save-dev.
At the end of that, I get the same message within the terminal:
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/me/project/front/node_modules/gulp-uncss/node_modules/uncss/node_modules/phridge/node_modules/phantomjs-prebuilt/node_modules/request/node_modules/hawk/lib/index.js:5:33)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
npm ERR! phantomjs-prebuilt#2.1.16 install: `node install.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt#2.1.16 install script.
npm ERR! This is most likely a problem with the phantomjs-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 15.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "gulp-uncss" "--save-dev"
npm ERR! cwd /Users/me/project
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, lstat '/Users/me/project/node_modules/gulp-uncss/node_modules/uncss/node_modules/request/node_modules/form-data/node_modules/async/node_modules/lodash/throttle.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 15.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "gulp-uncss" "--save-dev"
npm ERR! cwd /Users/me/project
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /Users/me/project/node_modules/gulp-uncss/node_modules/uncss/node_modules/request/node_modules/form-data/node_modules/async/node_modules/lodash/throttle.js
npm ERR! fstream_path /Users/me/project/node_modules/gulp-uncss/node_modules/uncss/node_modules/request/node_modules/form-data/node_modules/async/node_modules/lodash/throttle.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/me/project/npm-debug.log
npm ERR! not ok code 0
What/How can I solve that?
Related
I am a newbie to KOA framework, facing a issue while installing the mysql dependency using this command npm install knex-mysql-middleware on my windows xp machine. Below is the message i am getting on my console.
npm WARN package.json path#0.11.14 path is also the name of a node core module.
npm ERR! Error: ENOENT, chmod 'E:\testkoa\app3\node_modules\knex-mysql-middleware\node_modules\mysql\node_modules\readable-stream\node_modules\inherits\inherits.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 5.1.2600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "knex-mysql-middleware"
npm ERR! cwd E:\testkoa\app3
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path E:\testkoa\app3\node_modules\knex-mysql-middleware\node_modules\mysql\node_modules\readable-stream\node_modules\inherits\inherits.js
npm ERR! fstream_path E:\testkoa\app3\node_modules\knex-mysql-middleware\node_modules\mysql\node_modules\readable-stream\node_modules\inherits\inherits.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'E:\testkoa\app3\node_modules\knex-mysql-middleware\node_modules\mysql\node_modules\readable-stream\node_modules\core-util-is\float.patch'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
I've had a very similar problem before. You might try running:
npm cache clean
and see if that makes any difference.
OS: 10.9.2
I am using jhipster generator, and it seems to be an issue with package.json in mac, do we have any work around?
Below is the error:
npm ERR! Error: ENOENT, utime '/Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/readable-stream/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/hmajumdar/Work/sandbox/jhipster
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/readable-stream/package.json
npm ERR! fstream_path /Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/readable-stream/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call utimes
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, utime '/Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/inherits/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/hmajumdar/Work/sandbox/jhipster
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/inherits/package.json
npm ERR! fstream_path /Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/inherits/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call utimes
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/promised-io
npm http GET https://registry.npmjs.org/win-spawn
npm ERR! Error: ENOENT, lstat '/Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/typedarray/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/hmajumdar/Work/sandbox/jhipster
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/typedarray/package.json
npm ERR! fstream_path /Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/typedarray/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/uuid
npm http GET https://registry.npmjs.org/get-urls
npm http 304 https://registry.npmjs.org/astral-pass
npm http GET https://registry.npmjs.org/decompress
npm http GET https://registry.npmjs.org/get-stdin
npm ERR! Failed to parse json
npm ERR! Unexpected end of input
npm ERR! File: /Users/hmajumdar/.npm/tape/0.2.2/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/hmajumdar/Work/sandbox/jhipster
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! file /Users/hmajumdar/.npm/tape/0.2.2/package/package.json
npm ERR! code EJSONPARSE
npm http 304 https://registry.npmjs.org/win-spawn
npm http 304 https://registry.npmjs.org/get-urls
npm http 304 https://registry.npmjs.org/decompress
npm http 304 https://registry.npmjs.org/get-stdin
npm http GET https://registry.npmjs.org/object-keys
npm ERR! Error: ENOENT, lstat '/Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/output.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/hmajumdar/Work/sandbox/jhipster
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/output.js
npm ERR! fstream_path /Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/output.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
1910 error error rolling back Error: ENOTEMPTY, rmdir '/Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-cssmin/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/inherits'
1910 error error rolling back grunt-contrib-cssmin#0.9.0 { [Error: ENOTEMPTY, rmdir '/Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-cssmin/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/inherits']
1910 error error rolling back errno: 53,
1910 error error rolling back code: 'ENOTEMPTY',
1910 error error rolling back path: '/Users/hmajumdar/Work/sandbox/jhipster/node_modules/grunt-contrib-cssmin/node_modules/maxmin/node_modules/gzip-size/node_modules/concat-stream/node_modules/inherits' }
1911 error Failed to parse json
1911 error Unexpected end of input
1912 error File: /Users/hmajumdar/.npm/tape/0.2.2/package/package.json
1913 error Failed to parse package.json data.
1913 error package.json must be actual JSON, not just JavaScript.
1913 error
1913 error This is not a bug in npm.
1913 error Tell the package author to fix their package.json file. JSON.parse
1914 error System Darwin 13.1.0
1915 error command "node" "/usr/local/bin/npm" "install"
1916 error cwd /Users/hmajumdar/Work/sandbox/jhipster
1917 error node -v v0.10.28
1918 error npm -v 1.4.9
1919 error file /Users/hmajumdar/.npm/tape/0.2.2/package/package.json
1920 error code EJSONPARSE
1921 verbose exit [ 1, true
I think it was due to the way NPM was being installed in my machine, I cleared some caches and reinstalled npm. That solved it.
I have a problem installing mocha. I try to install mocha with the following line:
npm install -g mocha
This is the output which I get (If I type the http://registry.npmjs.org/mocha into the browser I'm able to see the json data):
npm http GET http://registry.npmjs.org/mocha
npm http 404 http://registry.npmjs.org/mocha
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
npm ERR! <html><head>
npm ERR! <title>404 Not Found</title>
npm ERR! </head><body>
npm ERR! <h1>Not Found</h1>
npm ERR! <p>The requested URL /mocha was not found on this server.</p>
npm ERR! </body></html>
npm ERR!
npm ERR! at Object.parse (native)
npm ERR! at RegClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\
node_modules\npm-registry-client\lib\request.js:203:23)
npm ERR! at Request.self.callback (C:\Program Files\nodejs\node_modules\npm\
node_modules\request\request.js:123:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\no
de_modules\request\request.js:893:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage.<anonymous> (C:\Program Files\nodejs\node_module
s\npm\node_modules\request\request.js:844:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "mocha"
npm ERR! cwd C:\Users\myName
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! type unexpected_token
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\myName\npm-debug.log
npm ERR! not ok code 0
After hours trying to resolve this issue I found this solution:
The problem which I had is connected to the proxy settings of npm. Which means that npm was not able to load the json file correctly.
You have to set the proxy settings first:
npm config set proxy http://username:password#YourProxy:Port
npm config set https-proxy https://username:password#YourProxy:Port (If you have one)
I am trying to install phonegap in ubuntu 12.04. Using this instraction. But there was an error,
npm http GET https://registry.npmjs.org/npm/1.3.7
npm http 500 https://registry.npmjs.org/npm/1.3.7
npm ERR! registry error parsing json
npm http GET https://registry.npmjs.org/npm/1.3.7
npm http GET https://registry.npmjs.org/npm/1.3.7
npm ERR! Error: connect ECONNREFUSED
npm ERR! at errnoException (net.js:901:11)
npm ERR! at Object.afterConnect [as oncomplete] (net.js:892:19)
npm ERR! { [Error: connect ECONNREFUSED]
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! syscall: 'connect' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'
npm ERR! System Linux 3.2.0-51-generic-pae
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "update" "-g"
npm ERR! cwd /home/mridul
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! syscall connect
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! stack Error: connect ECONNREFUSED
npm ERR! stack at errnoException (net.js:901:11)
npm ERR! stack at Object.afterConnect [as oncomplete] (net.js:892:19)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/mridul/npm-debug.log
npm ERR! not ok code 0
The fix for me was to run make test from the node.js folder. This identified that Curl was missing from my system.
sudo apt-get install curl
I am working with Node.js, Express.js and sqlite3 to create a small website.
I have developed my project in Ubuntu and I have been trying to get it to work in Mac also.
But after I svn checkout from my repository the folder of the project, and try to run my app.js file I get the following error:
module.js:356
Module._extensions[extension](this, filename);
^
Error: dlopen(/Users/cs205g1s13/BS/baby_skype_less/node_modules/sqlite3/build/Release/node_sqlite3.node, 1): no suitable image found. Did find:
/Users/cs205g1s13/BS/baby_skype_less/node_modules/sqlite3/build/Release/node_sqlite3.node: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/cs205g1s13/BS/baby_skype_less/node_modules/sqlite3/lib/sqlite3.js:1:104)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
The website works fine on Ubuntu. And also, the Mac computer has Node.js, sqlite3. Any help of why this is happening would be appreciated.
I removed the node_modules from my svn repository, and svn checkout my project folder into a mac computer. When I do npm install sqlite3 I get the following errors:
$ npm install sqlite3
npm WARN package.json application-name#0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/sqlite3
npm http 304 https://registry.npmjs.org/sqlite3
sqlite3#2.1.7 install /Users/cs205g1s13/BS/playing/node_modules/sqlite3
node-gyp rebuild
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp", line 15, in <module>
import gyp
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module>
import gyp.input
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 15, in <module>
import multiprocessing
ImportError: No module named multiprocessing
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:415:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Darwin 11.4.2
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node- gyp.js" "rebuild"
gyp ERR! cwd /Users/cs205g1s13/BS/playing/node_modules/sqlite3
gyp ERR! node -v v0.10.4
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! sqlite3#2.1.7 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the sqlite3#2.1.7 install script.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "sqlite3"
npm ERR! cwd /Users/cs205g1s13/BS/playing
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/cs205g1s13/BS/playing/npm-debug.log
npm ERR! not ok code 0
Did you check in your node_modules folder into svn? Don't do that. To fix it, run npm rebuild on your Ubuntu box. sqlite uses extensions that must be compiled on the host platform.