I'm trying to start a new project in React Native but I'm getting errors when I try to launch iOS Simulator. I have not edited the index.ios.js. I'm using iOS Simulator to run the project, and the error in the emulator is 'Could not connect to development server...'
Looking for JS files in /Users/jeff/Documents/TestApp
ERROR EACCES, permission denied '/Users/jeff/.babel.json'
{"errno":-13,"code":"EACCES","path":"/Users/jeff/.babel.json","syscall":"open"}
Error: EACCES, permission denied '/Users/jeff/.babel.json'
at Error (native)
at Object.fs.openSync (evalmachine.:500:18)
at Object.fs.writeFileSync (evalmachine.:1099:15)
at save (/Users/jeff/Documents/TestApp/node_modules/react-native/node_modules/babel-core/lib/api/register/cache.js:35:19)
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions. evalmachine.:565
fs.write = function(fd, buffer, offset, length, position, callback) {
^ Error: EACCES, permission denied '/Users/jeff/.babel.json'
at Error (native)
at Object.fs.openSync (evalmachine.:500:18)
at Object.fs.writeFileSync (evalmachine.:1099:15)
at process.save (/Users/jeff/Documents/TestApp/node_modules/react-native/node_modules/babel-core/lib/api/register/cache.js:35:19)
at process.emit (events.js:107:17)
at process.exit (node.js:600:17)
at process. (/Users/jeff/Documents/TestApp/node_modules/react-native/packager/packager.js:143:11)
at process.emit (events.js:107:17)
at process._fatalException (node.js:236:26) Process terminated. Press to close the window
I had fixed this problem, and execute the following command
sudo chmod 777 ~/.babel.json
and then re-init the react-native project, it will be successful.
You can try just
nvm alias default iojs-v2
If that doesn't work try going through all the steps in the installation guide again. Then in your project folder
rm -rf node_modules/
npm i
In Xcode remove RCTWebSocketDebugger from your libraries:
YourProject > Libraries > RCTWebSocketDebugger
Then in Xcode Product -> Clean and try building again
Giving the admin permissions to the path ~/.babel.json should help. Try with this command:
sudo chmod 777 ~/.babel.json
Related
A year ago I've made a project for a course: https://github.com/GeorgeFlorian/Finished_link_project
Now, I am trying to make it work on my machine, but I have no luck.
I've got npm 7.13.0 and node 16.1.0.
I've ran npm update in order to update all the depencies.
Steps
I've cloned the repo into a PC than runs Linux Mint 20.1
I've ran npm install
npm update
npm run build and npm run serve return the same error:
georgeflorian#georgeflorian-desktop:~/New Volume/VSCode Projects/Finished_link_project$ npm run build
> proiect-link#0.1.0 build
> vue-cli-service build
таз Building for production...
ERROR Failed to compile with 1 error 2:55:41 PM
Syntax Error: TypeError: Cannot read property 'parseComponent' of undefined
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
ERROR Build failed with errors.
I have no idea how to trace the error: Syntax Error: TypeError: Cannot read property 'parseComponent' of undefined.
Also, the NodeJS server won't start:
georgeflorian#georgeflorian-desktop:~/New Volume/VSCode Projects/Finished_link_project/server$ node app.js
node:internal/fs/utils:343
throw err;
^
Error: ENOENT: no such file or directory, stat '/home/georgeflorian/New Volume/VSCode Projects/Finished_link_project/dist/favicon.ico'
at Object.statSync (node:fs:1527:3)
at resolveSync (/home/georgeflorian/New Volume/VSCode Projects/Finished_link_project/node_modules/serve-favicon/index.js:187:17)
at favicon (/home/georgeflorian/New Volume/VSCode Projects/Finished_link_project/node_modules/serve-favicon/index.js:61:12)
at Object.<anonymous> (/home/georgeflorian/New Volume/VSCode Projects/Finished_link_project/server/app.js:46:9)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47 {
errno: -2,
syscall: 'stat',
code: 'ENOENT',
path: '/home/georgeflorian/New Volume/VSCode Projects/Finished_link_project/dist/favicon.ico'
}
I believe that many dependencies are deprecated, but this begs two questions:
If it worked back then and it hasn't been touched since, why doesn't it work now ?
How can I fix all the deprecated dependencies if npm update did not fix them ?
Ultimately, I would like to learn how to approach this kind of situation. Thank you.
I have problems in my terminal when I want to install something with npm (gulp).
Please help, if you know something with it.
roman#MacBook-Pro-Roman advanced % npm
Error: EROFS: read-only file system, mkdir '/Roman'
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:171:20)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at process.emit (events.js:321:20)
at process._fatalException (internal/process/execution.js:165:25)
It looks to me you either have a file system that is set to read only. Possible due to some software/hardware issues or the permissions are not set correct for npm to write to the storage device.
I already found the answer:
sudo npm config set prefix ~/npm
React Native run-android shows starting js server... but no server is started like it was starting before (nodejs winodow opens) and in the end it show following error:
Running C:\users\deepa\appdata\local\android\sdk/platform-tools/adb -s
192.168.105.101:5555 reverse tcp:8081 tcp:8081
Starting the app on 192.168.105.101:5555
(C:\users\deepa\appdata\local\android\sdk/platform-tools/adb -s
192.168.105.101:5555 shell am start -n
com.aptencemobileapp/com.aptencemobileapp.MainActivity)...
Starting: Intent { cmp=com.aptencemobileapp/.MainActivity }
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Please someone help me!
I don't know but sometimes I also got the same error. You just need to clean android build using following command.
goto your projrct android folder using cd android
hit the gradlew clean
again run the same command you are running.
Hope this will solve your problem.
Finally resolved it!
I reinstalled react-native-cli , nodejs added all paths to system and run following command.
adb reverse tcp:8081 tcp:8081
I'm trying run an Ember project locally : https://github.com/cosmicjs/ember-real-estate-website?files=1. I'm using pycharm 2017 using git-bash as my terminal in win7. I have npm , node and ember installed . In pycharm my project looks like the screenshot.
After switching to the cosmic-real-estate folder:
$ ember build
Running without permission to symlink will degrade build performance.
See http://ember-cli.com/user-guide/#windows for details.
cleaning up...
Build failed.
The Broccoli Plugin: [Funnel: Funnel: index.html] failed with:
Error: EISDIR: illegal operation on a directory, symlink 'e:\ember-real-estate-website\cosmic-real-estate\app' -> 'e:\ember-real-estate-website\cosmic-real-estate\tmp\funnel-input_base_path-ZStiRJkX.tmp'
at Error (native)
at Object.fs.symlinkSync (fs.js:1069:18)
at symlinkWindows (e:\ember-real-estate-website\cosmic-real-estate\node_modules\symlink-or-copy\index.js:123:18)
at symlinkOrCopySync (e:\ember-real-estate-website\cosmic-real-estate\node_modules\symlink-or-copy\index.js:63:5)
at e:\ember-real-estate-website\cosmic-real-estate\node_modules\broccoli-plugin\read_compat.js:86:11
at tryCatch (e:\ember-real-estate-website\cosmic-real-estate\node_modules\rsvp\dist\rsvp.js:539:12)
at invokeCallback (e:\ember-real-estate-website\cosmic-real-estate\node_modules\rsvp\dist\rsvp.js:554:13)
at publish (e:\ember-real-estate-website\cosmic-real-estate\node_modules\rsvp\dist\rsvp.js:522:7)
at flush (e:\ember-real-estate-website\cosmic-real-estate\node_modules\rsvp\dist\rsvp.js:2414:5)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
The broccoli plugin was instantiated at:
at Funnel.Plugin (e:\ember-real-estate-website\cosmic-real-estate\node_modules\broccoli-plugin\index.js:7:31)
at new Funnel (e:\ember-real-estate-website\cosmic-real-estate\node_modules\broccoli-funnel\index.js:58:10)
at EmberApp._rawAppIndex (e:\ember-real-estate-website\cosmic-real-estate\node_modules\ember-cli\lib\broccoli\ember-app.js:694:12)
at EmberApp.index (e:\ember-real-estate-website\cosmic-real-estate\node_modules\ember-cli\lib\broccoli\ember-app.js:678:20)
at EmberApp.toArray (e:\ember-real-estate-website\cosmic-real-estate\node_modules\ember-cli\lib\broccoli\ember-app.js:1661:12)
at EmberApp.toTree (e:\ember-real-estate-website\cosmic-real-estate\node_modules\ember-cli\lib\broccoli\ember-app.js:1684:38)
at module.exports (e:\ember-real-estate-website\cosmic-real-estate\ember-cli-build.js:26:14)
at Builder.setupBroccoliBuilder (e:\ember-real-estate-website\cosmic-real-estate\node_modules\ember-cli\lib\models\builder.js:56:19)
at new Builder (e:\ember-real-estate-website\cosmic-real-estate\node_modules\ember-cli\lib\models\builder.js:30:10)
at BuildTask.run (e:\ember-real-estate-website\cosmic-real-estate\node_modules\ember-cli\lib\tasks\build.js:15:19)
There is a new node_modules folder visible as well:
How can I get this working?
When I run jsonplaceholder I get:
jsonplaceholder
JSONPlaceholder listening on http://localhost:3000
fs.js:432
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory 'data.json'
at Object.fs.openSync (fs.js:432:18)
at Object.fs.readFileSync (fs.js:286:15)
at Object.index.load (/usr/local/lib/node_modules/jsonplaceholder/node_modules/json-server/node_modules/lowdb/node_modules/underscore.db/src/node.js:11:24)
at Function.low.load (/usr/local/lib/node_modules/jsonplaceholder/node_modules/json-server/node_modules/lowdb/lib/index.js:110:29)
at reset (/usr/local/lib/node_modules/jsonplaceholder/index.js:6:14)
at Server.<anonymous> (/usr/local/lib/node_modules/jsonplaceholder/index.js:14:3)
at Server.g (events.js:180:16)
at Server.EventEmitter.emit (events.js:92:17)
at net.js:1052:10
at process._tickCallback (node.js:415:13)
Im on Ubuntu 13.10
Project's author here. Just to let you know, finally, this (old) bug was fixed. Sorry for the inconvenience caused.
I'm still not sure if this has anything to do with an outdated module, or a messed up npm installation or maybe I'm just lucky, but basically the problem is that the path to access "data.json" is wrong (maybe not wrong but incomplete).
What I did was open file:
gksudo gedit /usr/local/lib/node_modules/jsonplaceholder/index.js
and modify the following function:
function reset() {
// server.low.load('data.json') <-- ORIGINAL LINE
server.low.load(require('path').resolve(__dirname, 'data.json')); //<--MY FIX
}
Just save the file, and run jsonplaceholder again.