I recently wanted to update to Meteor 0.6.1 from 0.5.4 and just did a meteor update in terminal. Immediately got an error in my terminal that gets thrown basically when I try anything.
/Volumes/Macintosh HD/Users/martijn/.meteor/meteor: line 35: cd: /Volumes/Macintosh: No such file or directory
module.js:340
throw err;
^
Error: Cannot find module '/Volumes/Macintosh HD/Users/martijn/tools/meteor.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
I removed all of Meteor for a complete reinstall:
rm /usr/local/bin/meteor
rm -rf /usr/local/meteor
curl https://install.meteor.com | /bin/sh
Same error when I try to create a Meteor project in my Sites directory. Can't figure out whats causing this, it used to work great in my Sites directory. The only way to avoid this error is to paste all the docs, examples, packages, scripts and tools folders into my /Volumes/Macintosh HD/Users/martijn/ directory along with my projects which is very messy.
Was thinking that it might have to do something with that I'm running two harddrives in my Macbook, an SSD for the OS and HDD for my documents. /usr/local/bin where meteor gets installed is on my SSD. This seems to me like something is off with the paths of the installation, any ideas?
Thanks
This seems to have been a bug in how we escape directory names. You hit this because your home directory has a space in it ("Macintosh HD"). I believe I fixed this just now, and the fix should be released in 0.6.2: https://github.com/meteor/meteor/commit/c059c384fdf9e7169f25cc36d86fbc0ed0a9da83
I had this same issue. Luckily I had another computer with Meteor where the upgrade worked. So here is what I did:
I noticed that usr/local/bin had very different files in the working and not working computer. So I just copied all the files from the working computer into the non-working one. Now meteor works on both. Not sure it's the best approach, but solved my issue. Meteor commands work once more.
Hope this helps,
Paul
Related
I am new to react-native and have found an error that makes absolutely no sense to me.
I am trying to include a calendar library: https://github.com/wix/react-native-calendars
I have included the dependency for that library in my package.json file and run npm install
The project was running fine and as expected. I have simply added one line of code to the project:
import { Calendar, CalendarList, Agenda } from 'react-native-calendars';
Nothing else. However now I am getting a red error message when the app loads on device and this is what my console is saying:
error: bundling failed: Error: While trying to resolve module xdate
from file
/Users/Alex/Documents/workspace/mobile/node_modules/react-native-calendars/src/index.js,
the package
/Users/Alex/Documents/workspace/mobile/node_modules/xdate/package.json
was successfully found. However, this package itself specifies a
main module field that could not be resolved
(/Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js.
Indeed, none of these files exist:
*
/Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)
*
/Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)
at ResolutionRequest.resolveDependency (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:103:15)
at DependencyGraph.resolveDependency (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/node-haste/DependencyGraph.js:272:4579)
at dependencies.map.relativePath (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:376:19)
at Array.map ()
at resolveDependencies (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:374:16)
at /Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:212:33
at Generator.next ()
at step (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:313)
at /Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:473
at
However I have checked in the directory and in fact /Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js does exist. However I do not see any of this part: (.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
As to how /Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js/index can exist, that doesn't make sense because xdate.js is not a directory.
Any help?
It Usually happens if you try to install a module while your packager is open.
Try to delete node_modules folder and close the packager.
Then reinstall everything by npm install in your project directory.
First close your JavaScript bundler (Metro bundler in my case) and restart the application. This will create fresh dependency graph. This should solve the issue.
Just restart the bundler - no need to delete the Node Modules folder
I came across this issue when adding and using react-native-elements when using VS Code and Android Studio emulator on Linux Mint
In VS Code I had a terminal running Expo with Metro Bundler via 'npm start' command. After installing the react-native-elements in the folder (using 'npm install --save react-native-elements') and adding the import into the .js file I got the "However, this package itself specifies a main module field that could not be resolved" error.
In my case, this just involved a ^C in the terminal session to stop the Metro bundler and then running 'npm start' again. There was no need to delete the node modules folder at all.
If you're still getting the error even after deleting the ./node_modules folder and running npm install again, try doing the install with the --update-binary flag, i.e npm install --update-binary. This should clear out and rebuild any previously built packages on your machine.
Please don't delete the node modules folder.
The bundler has least to deal with node modules folder.
Instead close all the terminals. If using VS-code close that also.
Close all the local host server ports and if possible restart the system.
This might solve the issue.
If anyone have same issue, and remove node_module not working. Then you can try remove all node_module, package lock and using yarn to install node_module instead npm. Hope this help
None of the solutions above helped me except for restarting my MacBook. Wasted 30 minutes trying to fix this issue as I couldn't believe restarting my computer could be a solution.
I installed node.js with the windows installer. The folder structure formed is C:\Program Files\nodejs\node_modules\npm\node_modules. The last node_modules has all the module folders I guess.
I use the node.js command prompt to execute my js script. When the script is on Desktop, it executes all fine. When I shift my script to another folder in my C: it gives the error. I don't want to give the absolute path as it will have to be changed again and again. Anyways, what path should I give as absolute to make it just work
Error: Cannot find module 'curl'
at Function.Module._resolveFilename (module.js:489:15)
I have gone through the resolutions mentioned in other discussions. Have made the NODE_PATH environment variable. Have edited PATH variable to make it C:\Program Files\nodejs and not C:\Program Files\nodejs\. Have executed npm install -g npm and nothing seems to work.
Sorry for the trouble, if anyone has already started looking into it. I found the solution. In the node.js command prompt, in the project folder I executed the following 'npm install curl' which downloaded the curl packages into a node_modules folder in the folder which has my script. I anyways wonder, then how it worked when I had placed my project on Desktop. It seems that the way node.js finds modules has to be checked. FYI - I have not set the NODE_PATH and the path still has C:\Program Files\nodejs\ after I freshly installed it. Thank you!
Cannot find module '/Users/dq212/node_modules/#schematics/angular/application'
Error: Cannot find module '/Users/dq212/node_modules/#schematics/angular/application'
at Function.Module._resolveFilename (module.js:469:15)
at Function.resolve (internal/module.js:27:19)
at new ExportStringRef (/usr/local/Cellar/angular-cli/1.4.6/libexec/lib/node_modules/#angular/cli/node_modules/#angular-devkit/schematics/tools/export-ref.js:15:32)
at NodeModulesEngineHost._resolveReferenceString (/usr/local/Cellar/angular-cli/1.4.6/libexec/lib/node_modules/#angular/cli/node_modules/#angular-devkit/schematics/tools/node-module-engine-host.js:61:21)
at NodeModulesEngineHost.createSchematicDescription (/usr/local/Cellar/angular-cli/1.4.6/libexec/lib/node_modules/#angular/cli/node_modules/#angular-devkit/schematics/tools/file-system-engine-host-base.js:151:34)
at SchematicEngine.createSchematic (/usr/local/Cellar/angular-cli/1.4.6/libexec/lib/node_modules/#angular/cli/node_modules/#angular-devkit/schematics/src/engine/engine.js:82:40)
at CollectionImpl.createSchematic (/usr/local/Cellar/angular-cli/1.4.6/libexec/lib/node_modules/#angular/cli/node_modules/#angular-devkit/schematics/src/engine/collection.js:11:29)
at Object.getSchematic (/usr/local/Cellar/angular-cli/1.4.6/libexec/lib/node_modules/#angular/cli/utilities/schematics.js:40:23)
at Class.run (/usr/local/Cellar/angular-cli/1.4.6/libexec/lib/node_modules/#angular/cli/tasks/schematic-get-options.js:12:40)
at Class.beforeRun (/usr/local/Cellar/angular-cli/1.4.6/libexec/lib/node_modules/#angular/cli/commands/new.js:90:31)
I installed nvm, node, angular-cli, and typescript. When I try
ng new projectName
I get the above error. I'm new to a lot of these tools, but I did put in a ton of time looking for this error, not getting anywhere. Any help is appreciated.
I'm on Mac Sierra 10.12.6
I think you are using private npm registry and some of the libraries are blocked there.
you can see the npm registry by command npm get registry and it should give you https://registry.npmjs.org/
if you are getting something else, you can change that by git config set registry https://registry.npmjs.org/ to set it to public.
This is fixed. Somehow must have copied over, a node_modules folder into my user folder and not in my project directory. Silly oversight, colossal waste of time to figure out. Lesson learned. Conflicting folder caused lots of other Strange errors. Thank you.
Lesson, before re-installing the world, go to step one first.
I'm having a problem where I follow the AngularJS tutorial exactly and it gives me errors. Part of the problem is that the tutorial itself is a little ambiguous with what commands you should be running and where. It seems to assume that as a newbie, you're a complete expert already.
THE INSTRUCTION
"Install Node.js
If you want to run the preconfigured local web-server and the test tools then you will also need Node.js v0.10.27+ (yeah totally, that thing... I know exactly what you're talking about and whether I'll need it or not).
You can download a Node.js installer for your operating system from http://nodejs.org/download/.
Check the version of Node.js that you have installed by running the following command:
node --version (got this to work through trial and error. Apparently you have to run this through Git. Node.exe is just a mirage that seems like a program that runs commands and stuff).
Once you have Node.js installed on your machine you can download the tool dependencies by running:
npm install"
Notice how it doesn't tell me whether I'm running this command in Node or windows command prompt or Git. It assumes I'm an expert and totally know what to do through osmosis.
So I run the command in Git...
THE ERROR
~/Desktop/angular-phonecat (master)
$ npm install
module.js:339
throw err;
^
Error: Cannot find module 'C:\c\Chris' Documents\Cash Receipts\previous\node.js\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
Any idea what to do? Never had so much trouble installing a program in my life. 7 hours and counting.
I'm messing around with Node.js for the first time and decided to create a simple application using express. I followed the instructions from github in an empty directory like so:
npm install -g express
express
npm install -d
node app.js
When navigating to localhost:3000 I get the follow error:
Express
500 Error: Cannot find module './lib/jade'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object. (C:\dev\gravity_kata\node_modules\jade\index.js:4:5)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
When looking under node_modules\jade\lib I see all of Jade's library files, but no jade folder. So I created a folder under lib called jade and moved the library files there and now my default application works.
Now, seeing as I have nearly no experience with Node.js and Express I'm pretty sure I did something wrong. Does anybody have any idea what is going on here?
Edit:
I dove into the Jade code. Under Jade's index.js file it requires lib\jade and looking under the lib folder, there was no jade.js file. Well, that is the problem, but why is the jade.js file missing? When pulling the Jade source from npm, there is a jade.js file under the lib directory. I copied the lib folder from the downloaded source into the Jade module for my project and it works fine now.
So for some reason, npm isn't pulling down the jade.js file. The version in the packages.json file match the source i pulled down, 0.21.0. Anybody have an idea on why this happened?
cd to your express project folder and run "npm install", this will install all dependencies
For me, on windows, jade version 0.22.0 fixed the issue.
it probably has to do with the fact, that you installed express globally (-g), but the npm install -d was done locally. try to install them both globally, or as i would prefer, both locally:
sudo npm uninstall express -g
npm install express
npm install jade (or npm install -d)
Really make sure that all the module requires are correct. Javascript is very funny about telling you what is actually wrong. Try removing the jade template line and see what happens then.
I just found this problem with the error of jade module. Looks like the jade folder was doesn't created automaticly (some kind of bug). Now i resolved this with reinstall jade. After that the jade folder was automaticly created.
use npm uninstall gulp-jade and then install gulp-jade again