Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 147 Vote(s) - 3.57 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Express module not found when installed with NPM

#11
Finally with Linux a good way to do is to use the command : `sudo apt-get install node-express`

But with express 4 we must use express-generator to make app skeleton, install it with 'npm install express-generator -g', and then run 'express myapp' command.
see also [install express][1]


[1]:

[To see links please register here]

Reply

#12
It appears that while npm had been updated to install global modules into `/usr/local/lib/node_modules`, Node's own `require.paths` does not yet reflect this change.

There are two reasonable solutions:

1. Add the following code to the top of your application:

require.paths.push('/usr/local/lib/node_modules');

- Pro: non-invasive, easy to add

- Con: requires discipline, future versions of node _will_ restrict access to `require.paths`

2. As root, execute:

ln -s /usr/local/lib/node_modules /usr/local/lib/node

- Pro: reasonably non-invasive

- Con: requires root, modifies linux fs, might not survive system updates
Reply

#13
It may happen, if you're using windows, that the environment variable `NODE_PATH` is not set, and thus when you execute `node fileName.js` it won't find the libraries.

Check for the variable on your console, and if not present, create it. Give it the `NODE_HOME\node_modules` value, where `NODE_HOME` is your node install dir. This path is where npm install puts every module upon downloading.
Reply

#14
`require.paths` is removed, use the `NODE_PATH` environment variable instead.
Reply

#15
For all problems with express with a mac computer:

The solution is:

1. `chown` to your user the .npm folder :

<!-- language: lang-none -->

sudo chown -R Webmaste /Users/webmaste/.npm/

2. At your test folder or your folder:

<!-- language: lang-none -->

sudo npm install -g [email protected]

3. Invoke express from your actual location:

<!-- language: lang-none -->

/usr/local/share/npm/bin/express

4. `sudo cd . && npm install`

5. Finally:

<!-- language: lang-none -->

node app

------------------------------------------------------

the final message in the console should look like this:

> `Express server listening on port 3000 in development mode`
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through