I have cloned the repo for snack-web locally.
Followed the instructions as mentioned in the Readme.
But getting below issue:
$ if-env NODE_ENV=production && yarn start:prod || yarn start:dev
$ yarn domain
$ hotel start && hotel add http://localhost:3011 --name snack.expo
Started http://localhost:2000
Create ~\.hotel\servers\snack.expo.json
$ nodemon -e json,js,ts,tsx --watch src/server src/server/index.tsx --exec babel-node --extensions '.ts,.tsx'
[nodemon] 1.19.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): src\server\**\*
[nodemon] watching extensions: json,js,ts,tsx
[nodemon] starting `babel-node src/server/index.tsx --extensions '.ts,.tsx'`
D:\projects\snack-web\src\server\index.tsx:3
import path from 'path';
^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at Object.<anonymous> (D:\projects\snack-web\node_modules\#babel\node\lib\_babel-node.js:174:21)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
[nodemon] app crashed - waiting for file changes before starting...
Issue is already opened in github, but no reply.
Does anyone here on SO help me resolve this issue? Or help understand what is the real cause? Any workarounds?
Thanks!!
I think because of single quote in start:dev command. cmd does't support single quote.
try change package.json line 9 to this
"start:dev": "nodemon -e json,js,ts,tsx --watch src/server src/server/index.tsx --exec babel-node --extensions \".ts,.tsx\"",
Related
Every time I try to create a new React Native app, I receive this error in the Metro Bundler:
error Unexpected token =.
/Users/lukeschoenberger/repos/PodApp/node_modules/metro-cache/src/stores/HttpStore.js:31
static HttpError = HttpError;
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/Users/lukeschoenberger/repos/PodApp/node_modules/metro-cache/src/stores/HttpGetStore.js:12:19)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
info Run CLI with --verbose flag for more details.
Process terminated. Press <enter> to close the window
I'm running: npx react-native run-ios.
When I create the script, I create the app, I run: npx react-native init AppName
I'm on node v14.17.1.
The startup script also says: success Successfully launched the app on the simulator
What am I doing wrong?
I had the same error because I was running on node v10.
After switching to node v14.17.5 (npm v6.14.14) via nvm, it solved the issue.
Can you verify you are really on v14.17.1?
For me, I tried using node v14.17.5 and it didn't work. I removed:
static HttpError = HttpError;
static NetworkError = NetworkError;
from node_modules/metro-config/node_modules/metro-cache/src/stores/HttpStore.js
and it worked.
Can use patch-package as well:
yarn patch-package metro-config/metro-cache
I am trying to run IBM blockchain election system, Evote. link=https://github.com/IBM/evote.
when I am trying to run client by using "npm run serve". I am getting following error.
ahmed#ahmed-Inspiron-3580:~/evote/web-app/client$ npm run serve
> client#0.1.0 serve /home/ahmed/evote/web-app/client
> vue-cli-service serve
/home/ahmed/evote/web-app/client/node_modules/open/index.js:29
...options
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:533:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/ahmed/evote/web-app/client/node_modules/#vue/cli-shared-utils/lib/openBrowser.js:9:14)
You are probably using a very old version of node.js. You can check the version by doing
node -v
you need to be using node 8 (it may not work with any version higher than that).
I would recommend using nvm as a mechanism for managing node versions. See https://github.com/nvm-sh/nvm
I am not an expert in Vuejs or Vuecli, but I do manage to get stuff working.
I had a project i worked on before using Vuecli3 and webpack and now when I opened it after few weeks to make changes, i get the below error in dev mode
$ vue-cli-service serve --open --mode development --dashboard
internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module '../package.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Volumes/Drobo/Dropbox/NASDAQ Dubai/Marketdata-6-Indices/node_modules/.bin/vue-cli-service:5:25)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
Total task duration: 0.15s
The package.json file is right there in the root director and also the .lock file. Dont know what is the reason for this error in compiling.
Any help hightly appreciated
As #vesperknight mentioned in the comment, this issue tends to happen when you move the project's folder to another location.
To solve this (on Linux), from the root directory of your project:
Delete existing node modules.
rm -r node_modules
Reinstall all dependencies:
npm install
The first step seems to be important.
I have installed all the prerequisites and i am getting following error while registering node admin after npm install. If anyone can please help me out with the error:-
hitesh#hitesh-VirtualBox:~/medication-blockchain/drug-app$ node registerAdmin.js
/home/hitesh/medication-blockchain/drug-app/node_modules/fabric-client/node_modules/grpc/src/grpc_extension.js:57
throw e;
^
Error: Cannot find module '/home/hitesh/medication-blockchain/drug-app/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/hitesh/medication-blockchain/drug-app/node_modules/fabric-client/node_modules/grpc/src/grpc_extension.js:32:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Errors like the one in question most commonly show up because of installing gRPC on one platform/architecture/Node version, and then using it on a different one. This often comes up when loading an installed library into a docker image, or switching Node versions using nvm. In many cases, this can be resolved by running npm rebuild in the environment where the code will be run.
When u cloned sample, u also copied the node_modules, which doesn't work with ur pc parameters. First, delete the node_modules, reinstall with npm install -g (globally), restart the app, works fine.
Stop all running containers, and remove them:
$docker stop $(docker ps -a -q)
$docker rm $(docker ps -a -q)
Delete node_modules:
$cd medication-blockchain/drug-app/node_modules
Restart from scratch:
$cd medication-blockchain/drug-app
$./startFabric.sh
$npm install -g
$node registerAdmin.js
$node registerUser.js
$node server.js
Good morning!
I started a new project this morning on Cloud9, and when running "npm init", it prompted an update which I ran.
It seemed to install fine, but now when I went to "npm install" some packages, it returns the following error:
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at /home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/bin/npm-cli.js:22:13
at Object.<anonymous> (/home/ubuntu/.nvm/versions/node/v8.2.1/lib/node_modules/npm/bin/npm-cli.js:92:3)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
Any ideas on if this is a Cloud9 bug or if it's fixable?
Many thanks in advance!
I just had this very same issue with the update. I'm guessing there's some cloud9 specific issue with the way the update is handled. Ran the link below and it seems to have resolved the issue. Able to check the version and install packages now.
npm config delete prefix
Hope it helps.