TermKit icon indicating copy to clipboard operation
TermKit copied to clipboard

Error: require.paths is removed, use node_modules folders or The NODE_PATH environment variable instead

Open shvelo opened this issue 13 years ago • 32 comments

When running nodekit.js, it gets the following error: "Error: require.paths is removed, use node_modules folders or The NODE_PATH environment variable instead"

shvelo avatar Dec 07 '11 11:12 shvelo

+1, I'm new to node and don't know what to do. So TermKit is broken out of the box, for me.

ndbroadbent avatar Dec 15 '11 03:12 ndbroadbent

This would be the first time that I've used node, but did you run, or add the following in your .bashrc?

export NODE_PATH="/usr/local/lib/node"

Part of the brew install mentions that this needs to be added.

"Please add /usr/local/lib/node_modules to your NODE_PATH environment variable to have node libraries picked up."

prinny avatar Dec 15 '11 04:12 prinny

Thanks, but this doesn't solve the problem. It seems that other people are having the same issue too: https://github.com/visionmedia/express/issues/902

ndbroadbent avatar Dec 15 '11 04:12 ndbroadbent

I am running it on Windows, i've edited the files and solved this issue, but worker.js gets an error, somethink like "Bad Argument".

On Thu, Dec 15, 2011 at 7:10 AM, Nathan B < [email protected]

wrote:

Thanks, but this doesn't solve the problem. It seems that other people are having the same issue too: https://github.com/visionmedia/express/issues/902


Reply to this email directly or view it on GitHub: https://github.com/unconed/TermKit/issues/68#issuecomment-3156521

Nick Shvelidze https://plus.google.com/109510926758335973804/posts Student, Web Developer Tbilisi, Georgia Twitter: @shvelo96 http://www.twitter.com/shvelo96 Find me on Facebook http://www.facebook.com/shvelo96

shvelo avatar Dec 15 '11 10:12 shvelo

New to node as well, but it seems as if TermKit is designed to work out of the box with a 4.xx version of node, as the require.paths function has been removed in all 5.xx releases. This isn't a big deal, as you can just add the correct directories to your node_path and comment out the require.path function in nodekit.js.

But after doing this, It also seems that I'm missing the protocol module, which doesn't have a 5.xx compatible version and doesn't seem to be maintained any longer: https://github.com/Gozala/protocol. Ultimately I installed nvm and used a sandboxed version of node 0.4.12. After installing socket.io and protocol I eventually got TermKit up and running.

Phylodome avatar Dec 16 '11 17:12 Phylodome

why they not update it to work with new version of node?

ghost avatar Dec 28 '11 08:12 ghost

As noted in my previous comment, it likely has something to do with the fact that the protocol project is no longer maintained for newer versions of node... Ultimately this is supposed to be a standalone app, though, so hopefully the node.js env/reqs are in the process of being removed anyhow ;)

Phylodome avatar Dec 28 '11 09:12 Phylodome

Any idea when the issue will be fixed or if there are other workarounds than having a previous version of node installed again?

wfrank2509 avatar Dec 30 '11 14:12 wfrank2509

Same problem here, I had problems with old versions of node.js and I would rather stay with the latest version only. Would be glad if this is issue is put in some milestone :) Thank you

nacho4d avatar Jan 17 '12 08:01 nacho4d

I comment the line

// require.paths.unshift(__dirname + '/../Shared/');

Then run this

NODE_PATH=`pwd`/../Shared/ node nodekit.js

Instead of

node nodekit.js

and1truong avatar Jan 18 '12 04:01 and1truong

We hope the author can update this project...

oppih avatar Jan 21 '12 09:01 oppih

Comment out any lines in the source that uses require.paths, then set your NODE_PATH env to all the necessary folders like so,

cd TermKit; export NODE_PATH=`pwd`/Shared/:`pwd`/Node/:`pwd`/Node/shell/:`pwd`/Node/view/

In addition, for whatever reason the javascript source is using the RegEx object incorrectly all over the place. I don't know if this worked in the older version of node, but RegExp objects are being evaluated simply by treating them as a function (i.e. /[0-9]/(test)). I had to do a find and replace on misc.js, shell/meta.js, and shell/formatter.js to replace all instances of these with the correct use of the exec() method (i.e. /[0-9]/.exec(test)). I can submit a patch of my changes if anyone wants them.

I got this project working on Node v0.6.8.

boog avatar Jan 22 '12 19:01 boog

Working on a fix for this now

yocontra avatar Jan 26 '12 19:01 yocontra

Fixed here: https://github.com/derDoc/TermKit/commit/71df2a4b3713417e4035f0d736882f9f964bb24d

nes1983 avatar Feb 07 '12 11:02 nes1983

But how to apply it ? I tried git pull but nothing changed.

oppih avatar Feb 07 '12 13:02 oppih

Would be nice the owner of the project pull request #71 :)

Hasn't been updated for two months :(

nacho4d avatar Feb 15 '12 06:02 nacho4d

Ping!

Found this after I got the require.paths error.

Please pull the fixes the nice hackers coded! :D

Zearin avatar Feb 18 '12 01:02 Zearin

Guys,

I'm still getting that error in the newest version.

node.js:201 throw e; // process.nextTick error, or 'error' event on first tick

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

Any ideas how to solve that?

cziko avatar Feb 28 '12 00:02 cziko

Same here running node v0.6.11

node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.

jwarnox avatar Feb 29 '12 12:02 jwarnox

Same here when i use cocos2d-javascript

node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.

ajoshi1 avatar Mar 01 '12 22:03 ajoshi1

Alright everyone I think we've established that this is an error with latest versions of node - no need to abuse the github notifications.

yocontra avatar Mar 01 '12 22:03 yocontra

Sorry Contra no intention to abuse these notifications, fixed by setting up NODE_PATHS correctly - thanks

jwarnox avatar Mar 03 '12 09:03 jwarnox

npm install protocol npm install socket.io

File nodekit.js :


//require.paths.unshift(__dirname + '/../Shared/');
 and replace "io = require('socket.io-node')," by "io = require('socket.io'),"

The repository have changed

But I have a new problem:

TermKit/Node/node_modules/protocol/core.js:99 method[':this-index'] = signature[key].indexOf(protocol) ^ TypeError: Object #<SocketNamespace> has no method 'indexOf'

TimVille avatar May 09 '12 17:05 TimVille

Environment path update for Windows user (yes those still exist):

export NODE_PATH="C:\Users\IMarek\AppData\Roaming\npm\node_modules"

I explained bit more on: http://blog.i-evaluation.com/2012/09/17/error-cannot-find-module-express/

ghost avatar Sep 17 '12 21:09 ghost

after fixing this problem i see in node log only:

info  - socket.io started

and it freezes, any ideas?

actionless avatar Mar 27 '13 18:03 actionless

@actionless same here. updates?

tekknolagi avatar Sep 29 '13 22:09 tekknolagi

@tekknolagi don't tried it for very long time so don't know

actionless avatar Sep 29 '13 22:09 actionless

Still doesn't work even after setting export NODE_PATH="/usr/local/lib/node"

Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead. at Function.Object.defineProperty.get (module.js:388:11) at Object. (/usr/lib/node_modules/termkit/Node/nodekit.js:5:8) 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 Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:902:3

[bran@localhost termkit-git]$ sudo updatedb;locate termkit|grep bin /usr/bin/termkit /usr/lib/node_modules/termkit/node_modules/socket.io/support/expresso/bin /usr/lib/node_modules/termkit/node_modules/socket.io/support/expresso/bin/expresso

brando56894 avatar Feb 03 '14 00:02 brando56894

This is still a problem and this repository seems dead.

msimpson avatar Dec 19 '14 18:12 msimpson

That is not the dead which can eternal lie And with strange aeons even death may die

Ia Ia! Cthulhu Fhtagn!

shvelo avatar Dec 20 '14 07:12 shvelo