Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shvelo opened this issue Dec 7, 2011 · 32 comments · May be fixed by #79

Comments

@shvelo
Copy link

shvelo commented Dec 7, 2011

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"

@ndbroadbent
Copy link

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

@prinny
Copy link

prinny commented Dec 15, 2011

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."

@ndbroadbent
Copy link

Thanks, but this doesn't solve the problem. It seems that other people are having the same issue too: expressjs/express#902

@shvelo
Copy link
Author

shvelo commented Dec 15, 2011

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:
expressjs/express#902


Reply to this email directly or view it on GitHub:
#68 (comment)

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

@Phylodome
Copy link

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.

@ghost
Copy link

ghost commented Dec 28, 2011

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

@Phylodome
Copy link

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 ;)

@wfrank2509
Copy link

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

@nacho4d
Copy link

nacho4d commented Jan 17, 2012

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

@and1truong
Copy link

I comment the line

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

Then run this

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

Instead of

node nodekit.js

@oppih
Copy link

oppih commented Jan 21, 2012

We hope the author can update this project...

@boog
Copy link

boog commented Jan 22, 2012

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.

@yocontra
Copy link

Working on a fix for this now

@nes1983
Copy link

nes1983 commented Feb 7, 2012

Fixed here: derDoc@71df2a4

@oppih
Copy link

oppih commented Feb 7, 2012

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

@nacho4d
Copy link

nacho4d commented Feb 15, 2012

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

Hasn't been updated for two months :(

@Zearin
Copy link

Zearin commented Feb 18, 2012

Ping!

Found this after I got the require.paths error.

Please pull the fixes the nice hackers coded! :D

@cziko
Copy link

cziko commented Feb 28, 2012

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?

@jwarnox
Copy link

jwarnox commented Feb 29, 2012

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.

@ajoshi1
Copy link

ajoshi1 commented Mar 1, 2012

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.

@yocontra
Copy link

yocontra commented Mar 1, 2012

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

@jwarnox
Copy link

jwarnox commented Mar 3, 2012

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

@TimVille
Copy link

TimVille commented May 9, 2012

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 # has no method 'indexOf'

@ghost
Copy link

ghost commented Sep 17, 2012

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/

@actionless
Copy link

after fixing this problem i see in node log only:

info  - socket.io started

and it freezes, any ideas?

@tekknolagi
Copy link

@actionless same here. updates?

@actionless
Copy link

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

@brando56894
Copy link

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

@msimpson
Copy link

This is still a problem and this repository seems dead.

@shvelo
Copy link
Author

shvelo commented Dec 20, 2014

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

Ia Ia! Cthulhu Fhtagn!

@msimpson
Copy link

Goth kids . . .

@coderaiser coderaiser linked a pull request Jan 8, 2015 that will close this issue
@gct-faisal
Copy link

The path error suppression fix does not fix the failure to launch.
TermKit dead in the water in current repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.