I am building frontend of a web app using vuejs. till yesterday my app was running fine but all of sudden today yarn serve command is throwing an error.
Error: watch /home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/public ENOSPC
at _errnoException (util.js:1022:11)
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
at createFsWatchInstance (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:232:14)
at FSWatcher.NodeFsHandler._handleDir (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:414:19)
at FSWatcher.<anonymous> (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:462:19)
at FSWatcher.<anonymous> (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:467:16)
at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I did try to look into the documentation but it was of no use. I also tried to start a new project altogether but it was of no help. any suggestions? if it's of any use I am using Linux Mint 19 as my os.
Well I had the same problem with npm.
You can try to clean the npm cache remove the node module folder and re install the dependencies try this code in your terminal.
cd ~
sudo rm -rf .npm
cd <package folder where node module exist>
npm cache clean
rm -rf node_modules
npm install
try same logic with yarn it will solve your problem.
Related
I'm trying to build a project in expo react native project.
My expo version is 3.2.2, sdkVersion is 35.
When I ran in cmd (on Windows 10)
set EXPO_DEBUG=true
expo build:android -c
I got:
Request failed with status code 400
Error: Request failed with status code 400
at createError (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\adapters\http.js:237:11)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
I'm tried to update expo version, sdkVersion, the version in react, check for internet connection.
Expo login and logout works fine. I don't have any proxy in my network.
I don't have any clues for what search or how to fix this problem.
Seems was a error in expo-cli version 3.2.2.
The update 3.2.3 fixed for me.
I have fixed the issue by using this command
Move to your root folder then type this command in your terminal
npm install -g expo-cli
I had two versions of expo-cli installed (one via yarn global install expo-cli and one as a dev dependency in project yarn add -D expo-cli). This started working for me after I removed the global expo-cli:
yarn global remove expo-cli
and used the local version in my project instead:
yarn run expo-cli start
Run those following command, then we are good to go.
$ yarn global remove expo-cli && yarn global add expo-cli
$ rm -rf node_modules/ yarn.lock && yarn install
$ yarn run start
I am trying to run react-native start and the following error appears
"Cannot find module 'metro-core'. Run CLI with --verbose flag for more details.
Prior to getting this message, I had a different error message saying modules was not located, so I tried this:
Delete the node_modules folder -
rm -rf node_modules && npm install
Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache
Clear watchman watches - watchman watch-del-all
I just typed in the react-native start and the error message popped up on the simulator, which told me to look at my terminal for the error message.
This is common with NPM. Do not worry. Just follow a few steps and you will get your package.
Step 1: $ npm cache clean --force
Step 2: delete node_modules by $ rm -rf node_modules folder or delete it manually by going into the directory and right-click > delete.
Step 3: npm install
To start again, $ npm start
This worked for me. Hopes it works for you too.
Still, if it is there, kindly checks the error it displays in red and acts accordingly.
Be careful when using rm -rf.
After that,
While working on Unix systems.
Sometimes it may not allow you to install such packages. For that, you need sudo permissions.
Sometimes, the package is installed but only in your local modules, and when you try to import(require) it from outside of the directory, the error occurs.
Sometimes, your compiler read your dependencies, but not able to find this package in that, at that time also you face this error.
Anyways, don't worry. You just have to follow some steps below.
A best practice is to initialize your project using npm init before starting development. This will initialize your project and generate package.json file. (Ignore it if your project have package.json file)
Then, if you want any library as dependencies, try --save with npm install command. This will save your dependency in package.json file.
e.g. npm install metro-core --save
If any package is not found after installing, install it globally by -g flag.
Globally installed packages will be accessible within your system. e.g. npm install metro-core -g.
Note: Unix system needs SUDO permission for installing it globally.
I hope this will help you.
npm install metro-core
use command then run
expo start
[21:03:34] Starting project at /home/sadaif/Documents/React-Native-App/my
[21:03:35] Expo DevTools is running at http://localhost:19002
[21:03:35] Opening DevTools in the browser... (press shift-d to disable)
[21:03:41] Error: node_modules directory is missing. Please run `npm install` in your project directory.
[21:03:41] Couldn't start project. Please fix the errors and restart the project.
[21:03:41] Set EXPO_DEBUG=true in your env to view the stack trace.
I run this command npm install but noting happened
then i run these commands
rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install
When I run command expo start then this error show in the terminal .I'm Using first time expo cli i m a beginner so that's why have no idea how to fix this issue if anyone know please help me.
either you are using Mac or Ubuntu the directory you have created the project in needs superuser permissions to modify it.
either run all commands with sudo or change the ownership
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
or re-install the node with
npm install -g node#latest --unsafe-perm
i was trying to run vuejs documentation offline (locally) and had no lack, it worked in the past but i don't know what i have done wrong.
i followed the steps on the following post
hear
basically the steps are
install hexo-cli globally
npm install hexo-cli --global
clone vuejs.org repository
git clone https://github.com/vuejs/vuejs.org.git
install project dependencies
cd vuejs.org && npm install
run local server using npm or hexo
npm start
i keep gett
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: watch /vuejs.org/themes/vue/layout/icons/ltc.ejs ENOSPC
at _errnoException (util.js:1022:11)
at FSWatcher.start (fs.js:1374:19)
at Object.fs.watch (fs.js:1400:11)
at createFsWatchInstance (/vuejs.org/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/vuejs.org/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/vuejs.org/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/vuejs.org/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher.<anonymous> (/vuejs.org/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at FSReqWrap.oncomplete (fs.js:153:5)
You ran out of watchers. Proper solution would be to find out why that happened, however you can simply raise available amount of watchers.
fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
or remove files that are watched but aren't needed, for example some unused templates or assets.
You can find more options here:
Node.JS Error: ENOSPC
I have a JavaScript project using npm to manage its dependencies. I'm trying to migrate to Yarn.
When I run yarn install in the console, it gives me an error:
An unexpected error occurred: "ENOENT: no such file or directory,
chmod C:\....\node_modules\.bin\esparse"
From what I read on the yarn docs, just running yarn install should be enough. Why doesn't this work as expected?
I am using Yarn 0.17.0, npm 2.14.12 and Node 4.2.4.
The following Solution worked for me
rm -rf node_modules **/node_modules
rm -rf yarn.lock **/yarn.lock
yarn cache clean
yarn install
This is a pretty old question, but with latest yarn for now (1.17.3) the same problem arises.
The solution which works for me, although more time consuming, is to delete yarn.lock file.
Please keep in mind that afterward, all libraries will get updated to the latest versions according to the rules you specified in package.json file
I had a similar issue which was resolved by running the following commands:
npm install yarn -g --force
yarn --c
rm package-lock.json
rm yarn-lock.json
yarn install