Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead

I just freshly installed Node.js and now I'm trying to run a simple script, but I get the following error message:

Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
    at Function.<anonymous> (module.js:383:11)
    at Object.<anonymous> (/home/shawn/.node_libraries/[email protected]/index.js:4:21)
    at Module._compile (module.js:446:26)
    at Object..js (module.js:464:10)
    at Module.load (module.js:353:31)
    at Function._load (module.js:311:12)
    at Module.require (module.js:359:17)
    at require (module.js:375:17)
    at Object.<anonymous> (/home/shawn/Documents/Projets/jsonpExchange/server.js:1:77)
    at Module._compile (module.js:446:26)

What does it mean, and how can I solve it?

UPDATE:

$ node -v

v0.6.19

$ npm install express

npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/mime/1.2.4
npm http 304 https://registry.npmjs.org/mkdirp/0.3.0
npm http 304 https://registry.npmjs.org/connect
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/mime/1.2.4
npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/formidable
[email protected] ./node_modules/express
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])
like image 645
Shawn Avatar asked Jun 22 '12 20:06

Shawn


1 Answers

This error happens when some installed packages are built for an older version of nodejs.

Which version of node are you using?

$ node -v

Are you using npm (http://npmjs.org) to install packages? The output of install express should be like this:

$ npm install express
npm http GET https://registry.npmjs.org/express
npm http 200 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/mime/1.2.4
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/connect
npm http 304 https://registry.npmjs.org/mime/1.2.4
npm http 304 https://registry.npmjs.org/mkdirp/0.3.0
npm http 304 https://registry.npmjs.org/qs
npm http 200 https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/connect/-/connect-1.9.0.tgz
npm http 200 https://registry.npmjs.org/connect/-/connect-1.9.0.tgz
npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/formidable
[email protected] ./node_modules/express
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])
like image 84
Simone Lusenti Avatar answered Oct 05 '22 20:10

Simone Lusenti