Running npx create-expo-module results in "Error: npm exited with non-zero code: 1" - react-native

I'm trying to create my own Expo module following the instructions in the Expo documentation.
When I run the command npx create-expo-module and I fill out the information that it asks me for (name of npm package, module name, GitHub profile, etc.), it manages to do the first two steps of the module creation:
✔ Downloaded module template from npm
✔ Created the module from template files
But then it gives me this error in the 3rd step:
✖ Installing module dependencies
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\#expo\spawn-async\build\spawnAsync.js:41:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at spawnAsync (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\#expo\spawn-async\build\spawnAsync.js:7:23)
at installDependencies (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\packageManager.js:9:37)
at C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:49:56
at newStep (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\utils.js:21:22)
at Command.main (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:48:31) {
pid: 23924,
output: [ '', '' ],
stdout: '',
stderr: '',
status: 1,
signal: null
}
I'm able to create new Expo projects with expo init without an issue and run them with expo start, so I don't know what the issue could be. My version of the Expo CLI is 6.0.6 and npm is 8.19.2.

Related

Build (React native) Android app and generate .apk file by using turtle cli from azure devops pipeline

I am trying to build Android app by using turtle cli for this i am using below script.
![258988-image.png][1]
npm install -g turtle-cli
turtle cli has installed and build also started but failing at building section, i am getting below error.
I am stuck guys, Could you please guide me where i am doing mistake. Let me know if you need more information.
error:
Nov 9 13:06:46 turtle[19222] ERROR: Failed to build standalone app
err: Error: ./gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/node_modules/#expo/xdl/node_modules/#expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:520:26)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.emit (domain.js:475:12)
at maybeClose (internal/child_process.js:1088:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
...
at spawnAsync (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-
cli/node_modules/#expo/xdl/node_modules/#expo/spawn-async/src/spawnAsync.ts:26:19)
at spawn Async Throw Error (/#expo/xdl#59.2.1/src/detach/ExponentTools.ts:111:19)
at build Shell App sync (/#expo/xdl#59.2.1/src/detach/AndroidShellApp.js:1494:11)
at Object.create Android Shell AppAsync (/#expo/xdl#59.2.1/src/detach/AndroidShellApp.js:382:5)
at runShellAppBuilder (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/builders/android.ts:99:5)
at buildAndroid (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/builders/android.ts:31:26)
at /Users/runner/hosted tool cache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/bin/utils/builder.ts:87:7
at Command. (/Users/runner/hosted tool cache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
platform: "android"

How to solve create react app directories error?

I have installed react js and run the basics commands on CMD but it's saying and repeating the same every time as a screenshot. I also installed it globally, got node,npm, and created react app version. But when I create-react-app tutorial it's saying an error
C:\Users\ehsan>node -v
'node' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\ehsan>node -v
'node' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\ehsan>node -v
v16.16.0
C:\Users\ehsan>npm -v
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
8.11.0
C:\Users\ehsan>npm install -g create-react-app
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
changed 67 packages, and audited 68 packages in 5s
4 packages are looking for funding
run `npm fund` for details
2 high severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
C:\Users\ehsan>mkdir tut
Access is denied.
C:\Users\ehsan>create-react-app --version
5.0.1
C:\Users\ehsan>create-react-app tut
node:fs:1349
handleErrorFromBinding(ctx);
^
Error: EPERM: operation not permitted, mkdir 'tut'
at Object.mkdirSync (node:fs:1349:3)
at Object.module.exports.makeDirSync (C:\Users\ehsan\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\make-dir.js:23:13)
at createApp (C:\Users\ehsan\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:257:6)
at C:\Users\ehsan\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:223:9
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4048,
syscall: 'mkdir',
code: 'EPERM',
path: 'tut'
}
C:\Users\ehsan>create-react-app --version
5.0.1
C:\Users\ehsan>mkdir tut
Access is denied.
C:\Users\ehsan>mkdir -tut
Access is denied.
C:\Users\ehsan>create-react-app tutu
node:fs:1349
handleErrorFromBinding(ctx);
^
Error: EPERM: operation not permitted, mkdir 'tutu'
at Object.mkdirSync (node:fs:1349:3)
at Object.module.exports.makeDirSync (C:\Users\ehsan\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\make-dir.js:23:13)
at createApp (C:\Users\ehsan\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:257:6)
at C:\Users\ehsan\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:223:9
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4048,
syscall: 'mkdir',
code: 'EPERM',
path: 'tutu'
}
Kindly check your node installation, looks like it is either not installed or node has not been added to your environment path variable.
When that is solved running node --version in your terminal would verify.
After you can use
npx create-react-app#latest your_app_name
to create a react app in your desired directory

Nuxt App Output Error when trying to Create

I want to initialize a Nuxt Project using the command
yarn create nuxt-app <project-name>
i get this error:
C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\lib\installPackages.js:108
throw new SAOError(`Failed to install ${packageName} in ${cwd}`)
^
SAOError: Failed to install packages in C:\Users\AbdulAzeez\Desktop\vue-sax-demo
at ChildProcess.<anonymous> (C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\lib\installPackages.js:108:15)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.cp.emit (C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1051:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
__sao: true
}
error Command failed.
Exit code: 1
Command: C:\Users\AbdulAzeez\AppData\Roaming\npm\bin\create-nuxt-app
Arguments: vue-sax-demo
Directory: C:\Users\AbdulAzeez\Desktop
Output:
This is not the first time, i'm creating a nuxt-project, I'm just getting this Error recently!
I even tried using npx, the same Error
Try to use the LTS version of node.js, the v14 is not stable. The current LTS version is 12.17.0 or see this link for the official LTS version if you are seen this in the future ( https://nodejs.org/en/download/)
after that run >>>
npx create-nuxt-app <project-name>

"react-native init project" command not working

I am trying to create react native project with following command but getting error, Help me gyus:
react-native init Sample
Following error occurs:
This will walk you through creating a new React Native project in D:\React_Demos\Sample
Using yarn v1.17.3
Installing react-native...
yarn add v1.17.3
info No lockfile found.
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.npmjs.org/react-native: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 8888".
info If you think this is a bug, please open a bug report with the information provided in "D:\React_Demos\Sample\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Command failed: yarn add react-native --exact
at checkExecSyncError (child_process.js:621:11)
at execSync (child_process.js:657:15)
at run (C:\Users\sachin.salunkhe\AppData\Roaming\npm\node_modules\react-native-cli\index.js:294:5)
at createProject (C:\Users\sachin.salunkhe\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\sachin.salunkhe\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
at Object. (C:\Users\sachin.salunkhe\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
at Module._compile (internal/modules/cjs/loader.js:777:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 10924,
stdout: null,
stderr: null
}
Command yarn add react-native --exact failed.
Here is the yarn.log file:
Arguments:
C:\Program Files\nodejs\node.exe C:\Users\sachin.salunkhe\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js add react-native --exact
PATH:
C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\PuTTY\;C:\Users\sachin.salunkhe\AppData\Roaming\npm;C:\adb;C:\Program Files\Apache Software Foundation\apache-maven-3.5.4;\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Users\sachin.salunkhe\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\Users\sachin.salunkhe\AppData\Local\Android\Sdk\emulator\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\Apache Software Foundation\apache-maven-3.5.4\bin;C:\Program Files\Java\jdk1.8.0_181\;C:\Users\sachin.salunkhe\AppData\Local\Programs\Fiddler;C:\Users\sachin.salunkhe\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\sachin.salunkhe\AppData\Local\Yarn\bin
Yarn version:
1.17.3
Node version:
12.7.0
Platform:
win32 x64
Trace:
Error: https://registry.npmjs.org/react-native: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 8888
at ClientRequest.onError (C:\Users\sachin.salunkhe\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:151950:17)
at Object.onceWrapper (events.js:291:20)
at ClientRequest.emit (events.js:203:13)
at Socket.socketErrorListener (_http_client.js:399:9)
at Socket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
npm manifest:
{"name":"Sample","version":"0.0.1","private":true,"scripts":{"start":"node node_modules/react-native/local-cli/cli.js start"}}
yarn manifest:
No manifest
Lockfile:
No lockfile
First You Can Run This Command,
sudo npm install -g react-native-cli
then after run this command,
react-native init Sample
Make sure you have carried out this course.
choco install -y nodejs.install python2 jdk8 // If there is no choco, install it.
npm install -g react-native-cli
Download and install Android Studio // and setting Configure the ANDROID_HOME environment variable. and new SDK
react-native init AwesomeProject
First, remove node modules then install it again then install react-native cli. After that run init command.
I hope this is helpful for him.
1) Remove node_modules then update react native-cli with latest version.
2) npm install
3) react-native link
4) After that this command : react-native run-android
If you navigate to your npm folder before issuing the command, it should work, then you can always move the folder.
So
cd C:\Users\User\AppData\Roaming\npm
Then run
react-native init AppName

How to fix "Error: Watching remote files is not supported" problem in Visual Studio Code

I have Vue application that I don't run for a while and now I cannot start development server?! In meanwhile something updated and that don't work. I tried new clean vue/vuetify install and same problem!
Build for production works normally, only run development server don't work.
And important notice: when run "npm run serve" in command prompt (outside VS Code), it works normally. That not work only in VS Code Terminal. What is problem?
Node version is v10.16.0
Npm version is 6.10.3
VS Code About:
Commit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
Date: 2019-08-08T02:33:50.993Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17763
Error (from terminal window):
> Executing task: npm run serve <
> portal#0.1.0 serve d:\Wamp64\www\portal
> vue-cli-service serve
INFO Starting development server...
10% building 2/2 modules 0 active ERROR Error: Watching remote files is not supported.
Error: Watching remote files is not supported.
at Server.setupWatchStaticFeature (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:405:13)
at Object.watchContentBase (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:477:14)
at forEach (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:550:24)
at Array.forEach (<anonymous>)
at Server.setupFeatures (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:549:49)
at new Server (d:\Wamp64\www\portal\node_modules\webpack-dev-server\lib\Server.js:125:10)
at serve (d:\Wamp64\www\portal\node_modules\#vue\cli-service\lib\commands\serve.js:139:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portal#0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portal#0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sasa Gosovic\AppData\Roaming\npm-cache\_logs\2019-08-11T10_35_40_418Z-debug.log
The terminal process terminated with exit code: 1
Press any key to close the terminal.
Exactly the same issue here. I resolved it by rolling back the version of webpack-dev-server.
npm install webpack-dev-server#3.7.2 --save-dev
Looks like the setupWatchStaticFeature function has changed between 3.7.2 and 3.8.0 which is triggering the issue.
You can eddit the vue.config.js file, adding following code:
devServer: {
contentBase: './public'
}
More details: https://github.com/webpack/webpack-dev-server/issues/2190#issuecomment-520670599
Until the issue is open, a workaround could be to use Git Bash instead of Windows command line to run npm run serve. I modified Server.js to output the contentBase variable. When using Windows command line or Vue UI, the variable contained "c:\...". Using Git Bash on my Windows 10 machine it contains "C:\..." and it worked.