Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

TS2304: Cannot find name 'process'. #93

Closed
goldenbearkin opened this issue Jun 27, 2017 · 14 comments
Closed

TS2304: Cannot find name 'process'. #93

goldenbearkin opened this issue Jun 27, 2017 · 14 comments

Comments

@goldenbearkin
Copy link

npm install -g create-react-app
create-react-app react-typescript --scripts-version=react-scripts-ts
cd react-typescript
npm start

I got this right away.

./src/registerServiceWorker.ts
(12,7): error TS2304: Cannot find name 'process'.
@wmonk
Copy link
Owner

wmonk commented Jun 27, 2017

Hmm are all the typing installed? Think process should come from @types/node.

@goldenbearkin
Copy link
Author

I think so. This is my package.json

{
  "name": "react-typescript",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@types/jest": "^20.0.2",
    "@types/node": "^8.0.4",
    "@types/react": "^15.0.33",
    "@types/react-dom": "^15.5.1",
    "react": "^15.6.1",
    "react-dom": "^15.6.1"
  },
  "devDependencies": {
    "react-scripts-ts": "2.3.1"
  },
  "scripts": {
    "start": "react-scripts-ts start",
    "build": "react-scripts-ts build",
    "test": "react-scripts-ts test --env=jsdom",
    "eject": "react-scripts-ts eject"
  }
}

@wmonk
Copy link
Owner

wmonk commented Jun 27, 2017

Can you do npm ls --depth=0

@goldenbearkin
Copy link
Author

sure.

➜  react-typescript npm ls --depth=0
react-typescript@0.1.0 /development/github/moussypad/react-typescript
├── @types/jest@20.0.2
├── @types/node@8.0.4
├── @types/react@15.0.33
├── @types/react-dom@15.5.1
├── node-pre-gyp@0.6.36 extraneous
├── react@15.6.1
├── react-dom@15.6.1
└── react-scripts-ts@2.3.1

npm ERR! extraneous: node-pre-gyp@0.6.36 /development/github/moussypad/react-typescript/node_modules/node-pre-gyp

@wmonk
Copy link
Owner

wmonk commented Jun 27, 2017

Just tested and this is indeed not working. See there was a new release of @types/node 6 hours ago - so feel it might be related to that.

@seyaobey
Copy link

+1 Same problem here since 3 hours ago

@wmonk
Copy link
Owner

wmonk commented Jun 27, 2017

Also typescript@4 was released earlier.

@wmonk
Copy link
Owner

wmonk commented Jun 27, 2017

Yup typescript@2.4.x is the culprit. I will push a fix pinning to 2.3.x

@seyaobey
Copy link

@wmonk great job by the way! I just discovered this tool a few days ago. It has boosted my productivity...

@wmonk
Copy link
Owner

wmonk commented Jun 27, 2017

Once these go green I will publish!

@wmonk
Copy link
Owner

wmonk commented Jun 27, 2017

Fixed in 2.3.2, get from npm now! If you need to update just, npm i react-scripts-ts@latest inside your created app.

@wmonk wmonk closed this as completed Jun 27, 2017
@micapam
Copy link

micapam commented Jun 1, 2018

I'm seeing this with typescript 2.8.3 and @types/node 10.1.3

@ulmanA
Copy link

ulmanA commented Jun 13, 2018

I had that issue and the root cause was from my tsconfig.json
adding "node" to list "compilerOptions"."types" solve the issue.

@russell-osu
Copy link

russell-osu commented Jul 3, 2018

Thanks. Adding "node" to list "compilerOptions"."types" also solved the issue for me.

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

No branches or pull requests

6 participants