Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-react-native-app not working with Yarn and NPM both #246

Closed
saisandeepvaddi opened this issue Jun 6, 2017 · 5 comments
Closed

create-react-native-app not working with Yarn and NPM both #246

saisandeepvaddi opened this issue Jun 6, 2017 · 5 comments

Comments

@saisandeepvaddi
Copy link

Description

Not able to create project with Yarn and NPM. Yarn causes gyp errors. NPM causes package starting errors.

Expected Behavior

What action did you perform, and what did you expect to happen?
With npm project (Yarn uninstalled) -> create-react-native-app testcrna
With yarn project -> create-react-native-app testcrnayarn

Observed Behavior

With NPM

Sandeep testcrna $ npm start

> testcrna@0.1.0 start C:\Users\Sandeep\Desktop\Programming\react-native\testcrna
> react-native-scripts start

15:08:22: Starting packager...
15:08:23: Error starting packager: Error: Couldn't start project. Please fix the errors and restart the project.
    at C:\xdl\src\Project.js:1039:11
    at Generator.next (<anonymous>)
    at step (C:\Users\Sandeep\Desktop\Programming\react-native\testcrna\node_modules\xdl\build\Project.js:1461:191)
    at C:\Users\Sandeep\Desktop\Programming\react-native\testcrna\node_modules\xdl\build\Project.js:1461:361
    at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testcrna@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testcrna@0.1.0 start 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\Sandeep\AppData\Roaming\npm-cache\_logs\2017-06-06T20_08_24_176Z-debug.log

With Yarn

yarn install v0.24.6
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⡀ sqlite3: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolset
[-/1] ⡀ waiting...
[-/1] ⡀ waiting...
[-/1] ⡀ waiting...
error C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3: Command failed.
Exit code: 1
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c node-pre-gyp install --fallback-to-build
Directory: C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.31
node-pre-gyp info using node@8.0.0 | win32 | x64
node-pre-gyp info check checked for "C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64\node_sqlite3.node" (not found)
node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.8 and node@8.0.0 (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http Unexpected token }

[SANDEEP]>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.1
gyp info using node@8.0.0 | win32 | x64
gyp info ok

[SANDEEP]>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64 )  else (node "" configure --fallback-to-build --module=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64 )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.1
gyp info using node@8.0.0 | win32 | x64
gyp info spawn C:\Users\Sandeep\.windows-build-tools\python27\python.exe
gyp info spawn args [ 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Sandeep\\Desktop\\Programming\\react-native\\testcrnayarn\\node_modules\\sqlite3\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Sandeep\\.node-gyp\\8.0.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Sandeep\\.node-gyp\\8.0.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\Sandeep\\Desktop\\Programming\\react-native\\testcrnayarn\\node_modules\\sqlite3',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\Sandeep\\Desktop\\Programming\\react-native\\testcrnayarn\\node_modules\\sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok

[SANDEEP]>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64 )  else (node "" build --fallback-to-build --module=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64 )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.1
gyp info using node@8.0.0 | win32 | x64
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 10.0.14393.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\build\deps\action_before_build.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\Sandeep\\Desktop\\Programming\\react-native\\testcrnayarn\\node_modules\\sqlite3\\lib\\binding\\node-v57-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\Users\\Sandeep\\Desktop\\Programming\\react-native\\testcrnayarn\\node_modules\\sqlite3\\lib\\binding\\node-v57-win32-x64"
gyp ERR! cwd C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:887:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Sandeep\\Desktop\\Programming\\react-native\\testcrnayarn\\node_modules\\sqlite3\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3
node-pre-gyp ERR! node -v v8.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn\node_modules\sqlite3\lib\binding\node-v57-win32-x64' (1)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Environment

In NPM created project

Sandeep testcrna $ npm ls react-native-scripts
testcrna@0.1.0 C:\Users\Sandeep\Desktop\Programming\react-native\testcrna
`-- react-native-scripts@0.0.30

Sandeep testcrna $ npm ls react-native
testcrna@0.1.0 C:\Users\Sandeep\Desktop\Programming\react-native\testcrna
`-- UNMET DEPENDENCY react-native@^0.44.0

npm ERR! missing: react-native@^0.44.0, required by testcrna@0.1.0
Sandeep testcrna $ npm ls expo
testcrna@0.1.0 C:\Users\Sandeep\Desktop\Programming\react-native\testcrna
`-- UNMET DEPENDENCY expo@^17.0.0

npm ERR! missing: expo@^17.0.0, required by testcrna@0.1.0
Sandeep testcrna $ node -v
v8.0.0
Sandeep testcrna $ npm -v
5.0.2
Sandeep testcrna $ watchman version
bash: watchman: command not found
Sandeep testcrna $  

In Yarn created project

Sandeep testcrnayarn $ npm ls react-native-scripts
testcrnayarn@0.1.0 C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn
`-- react-native-scripts@0.0.30

Sandeep testcrnayarn $ npm ls react-native
testcrnayarn@0.1.0 C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn
`-- react-native@0.44.3

Sandeep testcrnayarn $ npm ls expo
testcrnayarn@0.1.0 C:\Users\Sandeep\Desktop\Programming\react-native\testcrnayarn
`-- expo@17.0.0

Sandeep testcrnayarn $ node -v
v8.0.0
Sandeep testcrnayarn $ npm -v
5.0.2
Sandeep testcrnayarn $ yarn --version
0.24.6
Sandeep testcrnayarn $ watchman version
bash: watchman: command not found

Also specify:

  1. Operating system: Windows 10
  2. Phone/emulator/simulator & version:

Note: Windows build tools (https://www.npmjs.com/package/windows-build-tools) also installed

@brentvatne
Copy link
Member

Hello! Thanks for the detailed report. It's worth noting that we clearly state in readme that npm5 is not supported because it is still buggy.

Outside of that, can you try installing the sqlite3 lib on a new project? To do that, you can just make a new directory, then run yarn init and press enter a few times, then run yarn add sqlite3.

If that doesn't work, you might want to go back to node 7 and try it again. If that works then your issue should be resolved. It seems like there may be problems building sqlite with node 8 on windows: TryGhost/node-sqlite3#825

@saisandeepvaddi
Copy link
Author

@brentvatne Awesome. It worked with Node 7.
But after the creation of project, in expo app in my mobile gives me following error
"Something went wrong. Could not load exp://192.168.128.2:19000. Network response timed out."

Network connection in my laptop and mobile are good and are on the same network.

@saisandeepvaddi
Copy link
Author

@brentvatne It worked with XDE though. Thank you for help getting this issue resolved.

@brentvatne
Copy link
Member

if it worked with XDE then I suspect something was wrong with the network -- for example if you are on the same wifi but the network is locked down like a public wifi network (eg hotel, restaurant, cafe) often is, then you can't connect to web servers or anything on other devices on the network. XDE creates a tunnel for you automatically, so that's why it would work there. we don't do that for create-react-native-app because the tunnel service is a paid service and we didn't want to couple create-react-native-app to it.

@saisandeepvaddi
Copy link
Author

@brentvatne I don't think it's the problem with network. Seems like Windows has issues. I've installed WSL(Bash) on Windows and if you start from bash it's working. Works well from Ubuntu OS too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants