I'm getting the following error when I try to use "grunt serve".
/Users/name/Documents/projectname/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.js:6755
});
SyntaxError: Unexpected end of input
at Module._compile (module.js:439:25)
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 Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/name/Documents/projectname/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js:16:9)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
Any help would be appreciated. Thank you!
-Dave
I had a similar issue that produced the same SyntaxError: Unexpected end of input error for me. Resolution for this was to remove my project's node_modules directory and re-run npm install. If you are using a linux machine make sure to run it as sudo npm install whereas on windows you'll want to run your command prompt as Admin. Hope this helps!
Related
I am trying to get into Discord bot making, and I have node installed, version 17.3.0.
When I try to run npm init in a blank folder on my desktop, it throws me this error:
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
It will throw me this error when I try to run any npm command. I have never seen any error like this before in this situation, and I haven't found any other person via google that's encountered this situation.
Any help is appreciated. I could be (probably am) overlooking something extremely simple and overthinking the f out of this.
Update:
The issue ended up being there was an old install of Node on my computer that did not properly uninstall when I tried to uninstall it. This caused all my issues. Thank you to everyone who tried to help, problem solved.
If anyone comes across this issue, the old version will be located in your nvm folder within your AppData directory.
That's a weird one. I would suggest using Node 16.13.1 LTS instead. LTS means Long Term Support. This means that it is probably more stable than that Node calls the "current" version. Also, since you are using Windows, try the installers available on Node.js' homepage instead of nvm. I've had issues with nvm in the past, though I've never tried it on Windows.
I've installed a weexpack project.
When I am trying to run the command weexpack run web It's showing error.
module.js:442
throw err;
^
Error: Cannot find module '../src/run/Web'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/dev03/.nvm/versions/node/v6.2.1/lib/node_modules/weexpack/bin/weexpack-run:7:16)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
Can anyone help me with it?
As mentioned by #zahidul-islam-suzon in the comment above, it looks like this is a case sensitivity bug in weexpack: https://github.com/weexteam/weex-pack/issues/148#issuecomment-302861410
It can be fixed by renaming /usr/local/lib/node_modules/weexpack/src/run/web.js (or wherever your weexpack is installed) to Web.js.
Meteor 1.3.2.4.
I got this error everytime I try to meteor run / meteor run ios-device a project with cordova-ios.
Log:
/Users/admin/Desktop/My-App/.meteor/local/build/programs/server/boot.js:324
}).run();
^
Error: Cannot find module './util.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/admin/.meteor/packages/babel-compiler/.6.6.4.1vgwjcg++os+web.browser+web.cordova/npm/node_modules/meteor-babel/cache.js:4:12)
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 Module.require (module.js:364:17)
Do you have any thoughts what can cause that issue?
UPDATE: This happens only on MAC, on WIN everything works.
Re-installing Meteor solved this issue.
If I run flylatex from github, get the following Error on Debian and Ubuntu. Is my nodejs stuff broken or has flylatex a error? At first I run npm install -d in the working directory. My version of nodejs is 0.10.25. The last output is npm info ok Has anyone an idea for fixing the problem?
rennecke#odin ~/flylatex ±master » nodejs app.js
module.js:340
throw err;
^
Error: Cannot find module './src'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/rennecke/flylatex/node_modules/share/index.js:2:18)
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 Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/rennecke/flylatex/app.js:10:13)
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
I had the same problem.
It's a "nodejs and coffee script" problem.
You have to find a way to explain to "nodejs" how to "compile on the fly" coffee script.
I was not able to find the solution but, on my side, the ./node_modules/share/src of coeffeescript was already compile in javascript in the ./node_moudules/share/lib
So I just edit the file :
./node_modules/share/index.js
comment the 2 lines
// require ('coffee-script');
// module.exports = require('./src'):
and add the line
module.exports = require('./lib');
And it's work.
I am still looking for a more "elegant" solution for a "one line" compilation of coffescript.
hope this helps.
I have js2coffee installed globally and I tried
js2coffee app.js > app.coffee
And I got the following error
module.js:340
throw err;
^
Error: Cannot find module 'nopt'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/lib/node_modules/js2coffee/out/lib/command.js:16:10)
at Object.<anonymous> (/usr/lib/node_modules/js2coffee/out/lib/command.js:273:4)
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 Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/lib/node_modules/js2coffee/out/bin/js2coffee:2:1)
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:901:3
Does anyone know how to fix this?
It appears that the nopt module is a devDependency of js2coffee and isn't installed during production.
To fix this, navigate to js2coffee's module folder and run npm install. That will also install development dependencies, although I'm not sure why js2coffee needs them the way you're using it.
So if you're using running a Linux machine, use these commands:
cd /usr/lib/node_modules/js2coffee
npm install
It seems like you installed the package globally using -g option.Try installing the package like
npm install package
in the project directory