I am trying to install yelp package using npm in meteor.
The commands provided is
npm install yelp
in my config.js file
yelp = Npm.require("yelp")
But i am getting an error as
ReferenceError: module is not defined
W20151022-13:28:11.884(5.5)? (STDERR) at
app/node_modules/yelp/node_modules/oauth/lib/_utils.js:2:1
W20151022-13:28:11.884(5.5)? (STDERR) at
app/node_modules/yelp/node_modules/oauth/lib/_utils.js:6:3
Is this the right way to add npm module in meteor. Or i have to define it somewhere else? Thanks in advance.
Use this package to add npm modules to your site:
https://atmospherejs.com/meteorhacks/npm
meteor add meteorhacks:npm
And read the documentation to see how to do it. Writing npm command in the terminal won't do anything to your Meteor project.
Related
I am trying to deploy the Turborepo example app to Vercel using instructions from here, and getting the error:
Error: No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"
How can I fix it?
Docs says that the build command npm install --prefix=../.. is only required if using npm workspaces, and doesn't apply when using pnpm or yarn workspaces. Since am using pnpm, I replace npm install --prefix=../.. with pnpm i -r and it worked.
I know how to install latest package using npm:
npm i <package>#latest
but when the package is actually a sub-package it throws an error:
npm i #react-native-firebase/auth#latest
Error:
ENOENT: no such file or directory ...
strange enough I was not able to find something on google after hours of search.
i think when u use
npm install --save #react-native-firebase/app
its the latest version. try it and see the documentation.
rnfirebase
I need to add a npm package in my meteor project (for example 'moment' package). First I typed this command :
meteor npm install --save moment .
The package.json dependencies updated (moment package added), also in node_modules.
I want to use this package, so I add this line in the client side:
const moment = require('moment');
I get this message in my browser console Uncaught SyntaxError: Unexpected identifier in this line !!
Did I miss something ?
You need to do meteor npm install meteor-node-stubs --save for this to work. See Using NPM Packages in the guide.
You can only use npm packages in meteor 1.3+. For any previous versions, you will need a wrapper package or you can use meteorhacks:npm.
I just cloned my meteor github repo to a new machine and now I have to npm install some packages again. I thought that they are part of the meteor app once I have them installed. (and I checked. they are in the node_modules folder and listed in the packages.json). Nonetheless, I get the error:
Can't find npm module 'react'. Did you forget to call 'Npm.depends' in package.js witin the 'modules-runtime'package?
I am running meteor 1.3.1
I just checked out my meteor project from github and tried to run it, but now meteor doesn't want to start, telling me that npm is missing
I start my project as follows:
$> MONGO_URL='mongodb://localhost:27017/meteor' mrt
...
=> Started proxy.
=> Errors prevented startup:
While building the application:
error: no such package: 'npm'
=> Your application has errors. Waiting for file change.
In my project I use npm like
var fs = Npm.require('fs');
What I don't understand is why it doesn't work. I tried to install npm
$> mrt add npm
but that didn't fixed it. Any suggestions what the problem might be ?
When you run the app with meteor command it only uses the packages installed locally in the /packages folder and built-in Meteor packages. To also install the atmosphere packages, you should run the app with mrt command. Alternatively, you could run mrt install, which downloads the atmosphere packages to the /packages directory, and thus allows you to start the app with meteor.