NPM ERR! When trying to run Meteor project - node.js

I'm trying to view someone else's Meteor project from Github. I cloned it then tried running it by typing 'meteor' but what results is this slew of errors. I've included a sample below. I am running the command prompt as administrator. Clearly this has something to do with Node or its packages but I'm at a loss of where I should go with this. If someone could give me a hint I would be grateful.
npm http GET https://registry.npmjs.org/camelcase
npm http GET https://registry.npmjs.org/map-obj
npm http 304 https://registry.npmjs.org/mime-db
npm http GET https://registry.npmjs.org/get-stdin
npm http GET https://registry.npmjs.org/repeating
npm http 304 https://registry.npmjs.org/async
etc. etc....
npm ERR! error rolling back errno: 50,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path:
'C:\Users\Kyle\Documents\Websites...
npm ERR! 'Object.oncomplete (fs.js:108:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command
"C:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\\node.exe"
"C:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-
os.windows.x86_32\dev_bundle\bin\node_modules\npm\bin\npm-cli.js"
"install"
npm ERR! cwd
C:\Users\Kyle\Documents\Websites\thisWebsite\packages\npm-container.npm\package-new-14v2dj3
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:\Users\Kyle\AppData\Local.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\node_modules\npm\node_modules\fstream\lib\writer.js:305:19
npm ERR! fstream_type Directory npm
ERR! fstream_class DirWriter
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error:
EPERM, mkdir
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.9
npm ERR! path...
npm ERR! fstream_stack Object.oncomplete (fs.js:108:15)
npm ERR!
Error: version not found: ansi-styles#2.2.0
npm ERR! at
C:\Users\Kyle\AppData\Local.meteor\packages\meteor-tool\1.1.10...
npm ERR! at Object.oncomplete (fs.js:108:15)
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.2.9200
npm ERR! command
"C:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\\node.exe"

Try running the CMD / Powershell with Administrator (Run as Administrator). and then install npm dependencies as Github usually don't store them do: npm install and npm start. If you keep getting the errors. go to C:\Program Files\nodejs\node_modules\
or where your nodejs is installed and do right click, choose 'Properties' and go to 'Security' tab and give privileges to the user you need and try running npm install. Good luck

This worked in my particular case:
Remove meteorhacks and npm-container by typing this in the console:
meteor remove meteorhacks:npm npm-container
Delete the 'npm-container' folder which is generated by the package.
Run 'npm init' to create a package.json
Copy the contents of packages.json to the dependencies section of package.json

Related

Previously working `gulp` project: `npm update` throws `tar.unpack untar error`

My project was previously working, but industrious people contributing to the repo added new dependencies, and now npm update throws tar.unpack untar errors left and right. How do I fix this?
I get many of these, but here is one such error block:
npm ERR! tar.unpack untar error /Users/foo/bar/.npm/lodash/3.10.1/package.tgz
npm http GET https://registry.npmjs.org/find-index
npm ERR! Error: ENOENT, utime '/Users/foo/bar/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/number.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!
npm ERR! System Darwin 15.0.0
npm ERR! command "node" "/usr/local/bin/npm" "update"
npm ERR! cwd /Users/foo/bar/
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /Users/foo/bar/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/number.js
npm ERR! fstream_path /Users/foo/bar/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/number.js
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)
NOTE: There were many similar issues (1, 2, 3) on SO but none were for updating a project that was already working, but on initial install.
Came across this issue on github. The short version of the story is to simply run:
npm cache clean
and then run npm update again.
NOTE: If you are trying to install something instead of updating a previously working project, this may not work for you; instead, see the SO posts linked to in the question, i.e. 1, 2, 3.

npm install cube Error: No dist in websocket-server package

Ubuntu 14.04 with newly installed nodejs npm mongodb
Install cube by npm install cube and it throws the errors:
npm ERR! Error: No dist in websocket-server package
npm ERR! at next (/usr/share/npm/lib/cache.js:746:26)
npm ERR! at /usr/share/npm/lib/cache.js:739:5
npm ERR! at RegClient.get_ (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:105:14)
npm ERR! at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:41:12)
npm ERR! at fs.js:268:14
npm ERR! at /usr/lib/nodejs/graceful-fs/graceful-fs.js:103:5
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/me/cube
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/me/cube/npm-debug.log
npm ERR! not ok code 0
I've tried sudo npm install cube, but it doesn't work too.
I've search the error info by google and sf, I got nothing.
I've found the error:
the official source is not available:
https://www.npmjs.com/package/websocket-server
It's seems the developer's website is closed...
I found the solution by browse the ResqueBoard Issues
Try this:
cd node_modules/
git clone https://github.com/miksago/node-websocket-server
mv node-websocket-server websocket-server
cd..
npm install cube
use the node-websocket-server to replace websocket-server.

npm err code eisdir errno -4068 whenever installing any package

I followed this guide to install node to my machine without having admin rights.
I put node.exe, (npm.cmd and node_modules ) both from the npm zip in C:\Users\rakibler\Node. I added that to my path. I ran npm install -g bower and got
npm ERR! Error: EISDIR, open 'C:\Users\rakibler\Node\bower'
npm ERR! at Error (native)
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:\\Users\\rakibler\\Node\\\\node.exe" "C:\\Users\\rakibler\\Node\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\Users\rakibler
npm ERR! node -v v0.12.7
npm ERR! npm -v 1.4.9
npm ERR! path C:\Users\rakibler\Node\bower
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\rakibler\npm-debug.log
npm ERR! not ok code 0
at the end. It also seems like something else is wrong, because everything it downloads goes to C:\Users\rakibler\Node instead of C:\Users\rakibler\Node\node_modules. Not sure what's going wrong here. Any idea?
i think you need to install the npm globlally using
"npm install -g npm"
and then use it in directory to install bower . i hope this will solve your issue

Create a full directory structure/skeleton through the terminal - expressJS/nodeJS

I have seen some tips on the internet on how to create the full directory structure for a node project with a command line with expressJS.
Here are some examples:
express express-skeleton << http://quickleft.com/blog/getting-started-with-express-in-node
./node_modules/.bin/express -t ejs << http://naholyr.fr/2011/08/ecrire-service-rest-nodejs-express-partie-1/
--l << http://www.techrepublic.com/article/build-nodejs-web-applications-with-express/
But none of those work for me. I have install express and update it to have it globally installed with npm update express -g but my terminal doesn't even recognize the command line express.
How can I build a web app skeleton easily with the command line? Thanks a lot
EDIT: when running the npm install -g express command line, I get this error message:
npm http GET https://registry.npmjs.org/express
npm http 200 https://registry.npmjs.org/express
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/express'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/express']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/express',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/express',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express"
npm ERR! cwd /Users/arnauddrizard/Documents/Dev/RestAPI
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/local/lib/node_modules/express
npm ERR! fstream_path /usr/local/lib/node_modules/express
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/express'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/arnauddrizard/Documents/Dev/RestAPI/npm-debug.log
npm ERR! not ok code 0
npm unable to create folder inside your application folder.
Give sufficient permissons to your folder, I hope that will fix your issue.
What output do you get when you run npm install -g express? The problem is most likely that npm install -g is not installing to somewhere that's in your PATH.

Node.js: npm doesn't install anymore

I don't know what I did wrong, but trying to install a module using npm returns errors. My concrete example (same results, no matter which module I would like to install):
npm install socket.io
Returns:
npm ERR! TypeError: Cannot call method 'replace' of undefined
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:332:45
npm ERR! at fs.js:117:20
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:53:5
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:62:5
npm ERR! at Object.oncomplete (fs.js:297:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "socket.io"
npm ERR! cwd /Users/Hassen/www/node/btask
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! type non_object_property_call
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Hassen/www/node/btask/npm-debug.log
npm ERR! not ok code 0
Any idea? Thanks in advance :)
This error is usually caused by a .git directory in current directory on which no commit has been made.
Either remove the directory or make at least one commit before trying npm again.
EDIT: From this npm issue page;
This issue has been fixed in the latest release. Please update to the latest node and npm (v0.8.17 and v1.2.0, respectively)

Resources