Getting error Cannot find module 'cryptile' while installing express js - javascript

I am new to node js and facing issue in installing express js. Please help in fixing the issue and install express js.
Now when i tried to install cryptiles module using the command "npm install cryptiles" i am getting the same error.

Just run npm install cryptiles then re-run your previous command
or if you don't want then go to your packages.json file and remove the dependency...
UPDATE :
Seems this package isn't supported anymore ..
To see yourself install globally:
npm install -g cryptiles
then install try to install in source destination
npm install cryptiles
You should get the following message:
npm WARN install Couldn't install optional dependency: Unsupported

Related

Unable to use typescript with expo - "It looks like you're trying to use TypeScript but don't have the required dependencies installed"

I am receiving an error while trying to use Typescript with my existing expo project.
While following the docs, I created a tsconfig.json file in the project root.
When running expo start, I am prompted to install the typescript dependencies. However, after these are successfully installed (tick message appears in console: √ Installed typescript#~4.3.5, #types/react#~17.0.21, #types/react-native#~0.67.6), I receive the following error:
It looks like you're trying to use TypeScript but don't have the required dependencies installed.
Please install #types/react by running:
yarn add --dev #types/react#~17.0.21
If you're not using TypeScript, please remove the TypeScript files from your project and delete the tsconfig.json.
error Command failed with exit code 1.
After following the instructions and running the yarn add .... command, I keep seeing the same error message.
I have tried deleting the node_modules folder and package-lock.json file to no avail. I have also tried following this answer.
Any assistance would be appreciated, thank you.
Seems to be a bug. It works if I install #types/react on the specific version that Expo requests (17.0.21).
yarn add --dev #types/react#17.0.21
Just re-install expo-cli npm install -g expo-cli.
I don't know which of the following worked, but I ran the following commands and the problem went away.
sudo npm install -g expo-cli
sudo npm install -g #types/react
sudo npm install -g #types/react-native
sudo npm install -g typescript
yarn add expo-cli
solved for me.
I had the same issue. I resolved it by :
1- delete the node_modules.
2- update expo to the latest version using npm i -g expo-cli
hope this will help someone
if you installed #types/react remove that from your dev dependencies

Gatsby - Error: Cannot find module '..\node_modules\gatsby\dist\utils\babel-loader.js'

When running gatsby develop, right after gatsby new with configurations provided in the tutorial here - https://www.gatsbyjs.com/docs/tutorial/part-1/, I am getting this error
Module build failed (from ../../my-first-gatsby-sitenode_modules/gatsby/dist/utils/babel-loader.js):
Error: Cannot find module '..\my-first-gatsby-site\node_modules\gatsby\dist\utils\babel-loader.js'
Solutions I have tried:
Delete node_modules, package-lock => npm install / yarn.
Run npm install in node_modules/gatsby.
npm -g --save babel-loader.
Please help if you have come across the error and been able to resolve it. TIA.
Run npm install in node_modules/gatsby.
npm install must be run in the root of your project, not inside node_modules.
Delete node_modules, package-lock => npm install / yarn.
You should only choose npm or yarn, not both.
Try the following:
Run the following: npm install --save gatsby-cli
If you have many audit warnings before the previous command, run: npm audit fix (in the root of your project).
Remove your node_modules and reinstall the dependencies in the root of your project by: npm install

nest Command not found

I followed the documentation to create my first NestJS project.
Installing the Nest CLI with the command npm i -g #nestjs/cli was successful.
The output was:
+ #nestjs/cli#6.3.0
updated 1 package in 11.326s
However, when I try to scaffold a project with the Nest CLI:
nest new project-name
I get the following error:
zsh: command not found: nest
Some details about my environment:
OSX
iTerm
npm version 6.5.0
Use npx #nestjs/cli instead of nest
e.g. npx #nestjs/cli g controller pages
I was also getting the same console error when npm installing!
Erro was
#nestjs/cli
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/#nestjs/cli
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/#nestjs
npm WARN notsup Unsupported engine for watchpack-chokidar2#2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"12.14.1","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2#2.0.0
How I wasn able to install =>
Solution
sudo npm install -g #nestjs/cli
Following command works in my windows 10
node -v
v14.16.0
npm -v
6.14.11
npx #nestjs/cli new project-name
I was having the same issue, what I did was:
Installed the latest node with npm install npm#latest -g
and then added the following to my .bash_profile
alias nest="/usr/local/Cellar/node/11.9.0/bin/nest"
Tested with nest --version and it worked.
For some reason the path is not being called correctly, hope it helps.
Working through a NestJS/Mongo DB tutorial i stumbled into this very same problem. After trying all of the solutions that were listed above, even turning my default profile back to bash instead of using zsh, i found that simply adding the /usr/local/bin and ~/.npm-global/bin to my path variable resolved the issue. Hopefully this helps someone else who may stumble on this in the future as well.
export $PATH="/usr/local/bin"
export $PATH="~/.npm-global/bin"
Were the two commands i ran from iTerm2 in order to add them to my PATH environment variable. Once this was done a simple
env
showed the entries in my $PATH environment variable and the nest -v command worked without any issues.
I had same error when I use GitBash.
I resoved it:
If you use windows:
Your use CMD: npm i -g #nestjs/cli
Then you can use gitbash:
Check version nestjs: nest --version
Create app nestjs: nest new name_project
I have faced same problem and solved ,following this
write the command NPM root -g
check where NPM is installed
add it to your path environment variable
You have to add the following line to your ~/.zshrc file:
source $HOME/.bashrc
This is needed so that the npm binaries are available on startup.
After all the answers that I tried, I used my method
After installing npm i -g #nestjs/cli in my mac terminal.
open bash file in macos by typing open ~/.bash_profile in mac terminal. Like you can type it anywhere.
Your bash will look like this and use this line
alias nest="~/.npm-global/lib/node_modules/#nestjs/cli/bin/nest.js"
Restart your mac for changes to be reflected in your terminal.
There you go nestjs cli is now working globally 2nd screenshot.
I have just succeeded with
npx #nets/cli new project
when asked what manager to choose from npm / yarn / pnpm
made choice for pnpm
cd project
npm run start
Take care!
Must use sudo in comandline for linux, otherwise the command nest cannot be add to /usr/local/bin folder:
sudo npm install -g #nestjs/cli
You can try to use sudo
sudo yarn global add #nestjs/cli
I got the same issue.
I just uninstalled and reinstalled nextjs.
Finally, I can use next -v

npm installation in command prompt

After setting new windows in my laptop,i am trying to install npm in command prompt.But i am facing an error which picture is given in below.Would anybody help me out?
If you don't specify a package to install (like npm install -g nodemon) npm will try to install all packages from the current package.json file. If there is non, npm will throw this error.
Npm is already installed. That is why the error message is not Command not found.
The specific command you issued npm install -g attempts to use npm to install the package in the current directory globally.
Leaving the point that installing packages globally is a bad idea aside, this is failing because you are running the command in a directory that does not contain a package. It is your home directory, not one containing a package.json file.
If you are trying to install npm(node package manager) do it by downloading it from here: https://www.npmjs.com/get-npm, then you are good to go.
The command you are actually giving is to install a package using npm(check https://docs.npmjs.com/cli/install).
Thats why the error shows could not install from "" as you have not specified any package to install.

Installing NPM packages conflicting with Node.js 5.0.0

I am trying to install npm packages, which i need for my code to work.
However when i try to install any npm package, it gives the same error:
Your environment has been set up for using Node.js 5.0.0 (x64) and npm.
C:\Windows\System32>npm install mime
C:\Windows\System32
└── mime#1.3.4
npm WARN ENOENT ENOENT: no such file or directory, open 'C:\Windows\System32\package.json'
npm WARN EPACKAGEJSON C:\Windows\System32 No description
npm WARN EPACKAGEJSON C:\Windows\System32 No repository field.
npm WARN EPACKAGEJSON C:\Windows\System32 No README data
npm WARN EPACKAGEJSON C:\Windows\System32 No license field.
C:\Windows\System32>
I have tried re-installing node.js twice, but this didn't work. I've also tried to run it as administrator and install it again, which didn't work.
My classmate also works with node.js, but whenever he isntalled node.js everything worked fine from begin, also installing npm packages.
I'd really appreciate your guys help!
Sincerely,
Ivar
The error messages you're receiving aren't telling you the installation failed, just that you don't have a package.json in the system32 folder. For global install add -g to the installation:
npm install -g mime --save
--save just means you save it to your package.json if you're in a root project that has a package.json.
There should be a node_modules in system32 provided you have writing access to it. (sometimes you need to enable that even for admins).
Well, actually it installed package. Check node_modules folder.
It complains that you don't have package.json file and README, etc.

Categories