I'm trying to run a http server using grunt. However, when I type grunt serve in the appropriate directory, I'm presented with the following errors:
Loading "connect_proxy.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
Running "serve" task
Warning: Task "configureProxies:server" not found. Use --force to continue.
My nodejs, node package manager, and ruby installations are at the following versions:
npm -v
1.3.10
nodejs -v
v0.10.25
ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
How do I get the missing dependency? I've tried this both on Windows 8 and on a fresh install of elementaryOS Freya. The exact same problem arises on both. Any ideas?
The problem was resolved by going into package.json and updating "grunt-connect-proxy" to ^0.2 to obtain the missing dependency.
Related
I have issue about missmatch node version for requirement load gRPC.
This issue appear when i run node js server using pm2, but when i did it using nodemon and node command, it running well
Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v88-darwin-x64-unknown
Found: [node-v64-darwin-x64-unknown]
i have already change my node version default to same as project, using:
nvm alias default x.x.x
but the result same,
Also i have already rm -rf node_modules and run npm install again, but the result is same,
Last, i have already doing npm rebuild and the result same error.
What want i know is, how we can solve this issue whatever missmatch version?
Why i already doing change default node version in global using nvm, but it still look like not change for project, look like it have some other settings/configuration that i did not done
The problem is that grpc is installed for Node 10, but you are trying to use it in Node 16. You can explicitly install it for Node 16 by running
npm install --target=16.0.0
Please note that the grpc package is deprecated with the recommendation that you use #grpc/grpc-js instead.
Trying to set up instance of Facebook CTF on an AWS EC2 instance running Ubuntu 16.04 and am running into the following error when doing the quick setup.
My current version of node-sass and node are
$ node -v
v15.4.0
$ npm node-sass -v
7.0.15
Interestingly, I get another vesion of node
$ npm node -v
7.0.15
The first two are supposedly compatible according to the Node Version Support Policy table on GitHub. The node version 7.0.15 is not compatible with the version of node-sass.
However, when I run grunt, it indicates an unsupported environment.
Note: I have tried using individual sass commands and it works.
grunt --force
Loading "sass.js" tasks...ERROR
>> Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (88)
>> For more information on which environments are supported please see:
>> https://github.com/sass/node-sass/releases/tag/v3.13.1
What I have tried/done-
Uninstall node-sass (include using -g, clear cache, remove package-lock.json) but oddly enough, node-sass does not get uninstalled.
Questions -
Why does the error log reference an older release of node-sass (v3.13.1)?
How do I reconcile versions?
Does it make a difference if some packages were installed as root user vs. regular user?
Solved it!
Why was I getting the error?
Tracing package.json and package-locked.json files both indicate the older version
"node-sass": "^3.7.0" and not the version I installed manually.
Solution -
uninstall node-sass, node
delete their node_module folders
run "npm install" to install any dependencies missing (node-sass and node)
Such that now when I check the versions installed, my output is as follow -
user#IP:/var/www/user# node -v
v6.17.1
user#IP:/var/www/user# npm node-sass -v
3.10.10
When reviewing the Node Sass support policy table on GitHub, these two versions are compatible. When I run grunt --force, there are no issues for node-sass.
Installed electron#4.0.0 (also tried #4.0.7) and installed grpc and #grpc/proto-loader. When I launch electron I get a runtime error
Uncaught Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: electron-v4.0-darwin-x64-unknown
Found: [node-v64-darwin-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Of course I tried running the suggested solution, npm rebuild, but that did not solve the problem. I also tried rebuilding the grpc module
npm rebuild grpc --build-from-source --runtime=electron --target=4.0.0 --target_archx64 --dturl=https://atom.io/download/electron
I tried uninstalling everything and starting from scratch. We're cloning the electron quick start repo and so after cloning and installing modules I installed grpc targeting a specific version
npm install grpc --runtime=electron --target=<electron version>
Which resulted in the same error so then I tried rebuilding
npm install --save-dev electron-rebuild // to rebuild grpc module
And if I delete node_modules and package-lock.json and then re-install npm install I get a success message (don't pay attention to the version, I'm watching my versions are matching) which looks like the "missing" module was installed
node-pre-gyp WARN Using request for node-pre-gyp https download
[grpc]
Success: "/../electron/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" is installed via remote
protobufjs#6.8.8 postinstall /../electron/node_modules/protobufjs
node scripts/postinstall
electron#4.0.8 postinstall /../electron/node_modules/electron
node install.js
I found the answer here:
https://github.com/grpc/grpc-node/issues/762
Still, the solution I tried is the solution I needed. Not sure what I was doing wrong initially!
For future Googlers the summary is this:
The grpc_node module seems to be compiled for NODE_MODULE_VERSION=64,
but Electron 4 since 4.0.4 switched ... to
specifying NODE_MODULE_VERSION=69 and there is a mismatch at runtime
trying to load the module.
So, what I did to solve was
Clone the electron quick start repo
Uninstall the version of electron that came with quick start
Install electron#4.0.0
Install gRPC with target to 4.0.0
npm install grpc --runtime=electron --target=4.0.0
I am working on a nodejs project. I get below error when launch the application.
Failed to load gRPC binary module because it was not installed for the current system
extensionHostProcess.js:293
Expected directory: node-v57-darwin-x64-unknown
Found: [node-v64-darwin-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/Users/dev/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node
From the description it means there are unmatched native dependencies version related to firebase. I tried npm rebuild which doesn't seem to work. I am using node version:
node: v8.9.4
npm: 6.2.0
How can I fix the dependencies issue? Should I try with particular node version or should I rebuilt some native libraries?
This is the first time I use yeoman to setup the scaffolding for an AngularJS app, and I have to admit I am likely new to the nodeJS, grunt and bower world.
So, here's what I've done so far:
I made sure yeoman, grunt-cli and the angular-generator packages are installed
npm install -g yo grunt-cli bower
npm install -g generator-angular
Generated my app
yo angular
I also tried:
yo angular --min-safe
So far, al seems good. Between the options given, I choose the Twitter Bootstrap one, no angular dependencies, and to overwrite my local .gitignore file.
After all that, I try to run my app:
grunt serve
At this point, grunt complains that it is not locally installed into the project, so I run:
npm install grunt --save-dev
No again, trying to run the app:
grunt serve
And this is where I get blocked:
C:\Projects\what-now>grunt serve
Running "serve" task
Running "clean:server" (clean) task
Running "concurrent:server" (concurrent) task
Running "copy:styles" (copy) task
Done, without errors.
Warning:
C:\Projects\what-now\node_modules\grunt-contrib-compass\node_modules\tmp\lib\tmp.js:261
throw err;
^
TypeError: Cannot read property 'stdout' of undefined
at compile (C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\compass.js:37:10)
at C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\compass.js:68:7
at C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\lib\compass.js:121:11
at _fileCreated (C:\Projects\what-now\node_modules\grunt-contrib-compass\node_modules\tmp\lib\tmp.js:172:7)
at C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:53:5
at C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:62:5
at OpenReq.Req.done (C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:142:5)
at OpenReq.done (C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:64:22)
//... stack trace continues ...
Looking at the code that blows up in compass' compile method, what I find is the following:
child.stdout.pipe(process.stdout);
This makes me think that child is undefined for some reason, and this variable comes from a call to grunt.util.spawn. This is where I am at a loss.
Am I missing any dependency? Am I missing any configuration?
Info:
OS: Windows 8 x64
node: v0.10.22
*sighs*, sorry.
All it took me is to write this question to then figure out I needed to have installed Ruby and the compass gem. Now it makes sense: the process for compiling would not spawn up.
After installing Ruby, run:
gem install compass
And you should be good to go.
EDIT: After you install Ruby, you need to make sure that the ruby runtime files' path is added to your PATH variable. (Thanks JagWire!)
On windows i had a few instalations of ruby:
C:\ruby187
and
C:\Ruby200-x64
install compass in both places, using:
gem install compass
this resolve my issue on windows 8 64bit
Following the same procedure for Ember, running grunt. Received the error "TypeError: Cannot read property 'stdout' of undefined." Did gem install compass (ruby had already been installed on my windows 7 64 bit) even though compass was supposed to be installed earlier and this worked. Ran grunt and grunt serve with no problems.