Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

node_waf: 'no such environment: default' #1716

Closed
jifeon opened this issue Sep 15, 2011 · 9 comments
Closed

node_waf: 'no such environment: default' #1716

jifeon opened this issue Sep 15, 2011 · 9 comments
Labels

Comments

@jifeon
Copy link

jifeon commented Sep 15, 2011

I get an error 'no such environment: default' while installation node-proxy ( https://github.com/samshull/node-proxy ) If I change line 567 of wafadmin/Build.py to "return self.env_of_name(DEFAULT)" ( previously it was "return self.env_of_name('default')" ) the problem goes away. I don't know this is node_waf bug or node-proxy bug or I am doing something wrong.. I follow http://permalink.gmane.org/gmane.comp.lang.javascript.nodejs/29563 to fix that problem.

npm install node-proxy

node-proxy@0.5.2 install /home/jifeon/projects/node.autodafe.js/node_modules/node-proxy
make

BUILDING: C++ Component
Checking for program g++ or c++ : /usr/lib64/ccache/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
'configure' finished successfully (0.071s)
Waf: Entering directory /home/jifeon/projects/node.autodafe.js/node_modules/node-proxy/src/build' no such environment: default Traceback (most recent call last): File "/usr/local/bin/node-waf", line 16, in <module> Scripting.prepare(t, os.getcwd(), VERSION, wafdir) File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare prepare_impl(t, cwd, ver, wafdir) File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl main() File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main fun(ctx) File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build return build_impl(bld) File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 399, in build_impl bld.add_subdirs([os.path.split(Utils.g_module.root_path)[0]]) File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 981, in add_subdirs self.recurse(dirs, 'build') File "/usr/local/bin/../lib/node/wafadmin/Utils.py", line 634, in recurse f(self) File "/home/jifeon/projects/node.autodafe.js/node_modules/node-proxy/src/wscript", line 13, in build obj = bld.new_task_gen('cxx', 'shlib', 'node_addon') File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 335, in new_task_gen ret = cls(*k, **kw) File "/usr/local/bin/../lib/node/wafadmin/Tools/ccroot.py", line 162, in __init__ TaskGen.task_gen.__init__(self, *k, **kw) File "/usr/local/bin/../lib/node/wafadmin/TaskGen.py", line 118, in __init__ self.env = self.bld.env.copy() AttributeError: 'NoneType' object has no attribute 'copy' cp: cannot statsrc/build//node-proxy.node': No such file or directory
make: *
* [all] Error 1
npm ERR! error installing node-proxy@0.5.2 Error: node-proxy@0.5.2 install: make
npm ERR! error installing node-proxy@0.5.2 sh "-c" "make" failed with 2
npm ERR! error installing node-proxy@0.5.2 at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing node-proxy@0.5.2 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing node-proxy@0.5.2 at ChildProcess.onexit (child_process.js:192:12)
npm ERR! node-proxy@0.5.2 install: make
npm ERR! sh "-c" "make" failed with 2
npm ERR!
npm ERR! Failed at the node-proxy@0.5.2 install script.
npm ERR! This is most likely a problem with the node-proxy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make
npm ERR! You can get their info via:
npm ERR! npm owner ls node-proxy
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.40.4-5.fc15.x86_64
npm ERR! command "node" "/usr/local/bin/npm" "install" "node-proxy"
npm ERR! cwd /home/jifeon/projects/node.autodafe.js
npm ERR! node -v v0.4.8
npm ERR! npm -v 1.0.27
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/jifeon/projects/node.autodafe.js/npm-debug.log
npm not ok

@ondreian
Copy link

I have also ran into this problem when installing now and forever via npm

@cwabbott0
Copy link

I also have this problem while installing hashlib, using node v0.4.12 and npm v1.0.30.

@bnoordhuis
Copy link
Member

Closing, cannot reproduce with current master. Note that ccache and waf don't play nice (and not just waf).

@justmoon
Copy link

I think these are the steps to reproduce:

Install latest Node.js from git (84d0b1b)
Install Node 0.4.x
Compile any module that uses node-waf

Example (node-buffertools and node-bigint):
https://gist.github.com/1303604

@justmoon
Copy link

And the fix is to run "sudo make uninstall" in the Node.js 0.5.x tree and then "sudo make install" in the Node.js 0.4.x tree.

@sveisvei
Copy link

@justmoon 'sudo make uninstall' works great

@chrisdew
Copy link

chrisdew commented Jan 4, 2012

I also had to run uninstall the 0.4.x tree and re-install - but it worked.

@sagarnikam123
Copy link

I am using node-v0.8.21 & getting problem "Checking for node path : not found" & "/home/trendwise/node_modules/db-mysql/wscript:34: error: The program ['mysql_config'] is required" while install db-mysql package. I don't find "return self.env_of_name('default')" in my Build.py, instead it is "return self.env_of_name('release')" & don't know where is my wscript located.What should I do ?

@bnoordhuis
Copy link
Member

@sagarnikam123 node-waf is deprecated. If a module author is still using it, bug him or her to switch to node-gyp.

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

No branches or pull requests

8 participants