简体   繁体   中英

Why doesn't npm work on a clean install of node on lubuntu?

I am not good with linux. I installed node in /node. node subsequently installed itself in a directory called node. So the node files are in /node/node. I gave /node all permissions:

sudo chmod 0777 -R /node

Node is up and running. I can write a node script no problem. When I try to install a module using NPM it fails.

sudo npm install --nodedir=/node/node jsdom
sudo npm install --nodedir=/node/node socket.io

eventually I just went crazy

sudo npm -g -f install --nodedir=/node/node jsdom
sudo npm -g -f install --nodedir=/node/node socket.io

With force it won't explicitly state that it has errored but then when I try and run an actual script using the module it fails stating there is no implementation.

Here is the terminal window.

More Details

I did a clean install of lubuntu on Virtual Box on another machine and then repeated the entire install process from scratch. That is:

  1. install lubuntu and virtual box guest additions
  2. sudo apt-get install eclipse-cdt
  3. sudo apt-get install g++ curl libssl-dev apache2-utils
  4. sudo apt-get install git-core
  5. cd .. to / (i believe this is called the root directory)
  6. git clone git://github.com/ry/node.git (this creates /node with files inside)
  7. cd node
  8. ./configure
  9. make
  10. sudo make install
  11. sudo npm install jsdom

and it is still giving the same error . I used these instructions for installing node on linux (although the instructions were written in 2010). Anyway, that is about as clean of an install as you can get but it is still failing.

This is a harmless warning. It tells that this particular package (policyfile) had no (git) repository specified in its package.json file at the time when version 0.0.4 was published.

The warning is really added as a means to stimulate module authors to add a repository field to their packages at time of publishing. The warnings at time of publishing are merely a by-product.

Another warning you may come across often is "No README data". For this, the same applies.

I do think it would be better if these kind of warnings would be silenced when installing, as they virtually indicate problems in behavior of a package when installed. That is, I have yet to come across a package that did behave wrongly because of it, and I do not see much chance for this to be the case.

I am the current maintainer of the module which originates the warning message ( normalize-package-data , but I do not control what is done with these warnings afterwards (ie whether they are shown to the user or ignored). I'll raise an issue about this on the npm project .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM