Fails after `npm install` (TypeError: Cannot read property 'program' of null)
See original GitHub issueI run with this issue in one of my projects.
I cloned detrohutt/babel-plugin-inline-import-graphql-ast run npm run test
then faced the same issue :
FAIL tests/schema.test.js
● simple schema document › inlines as raw unparsed text'
TypeError: Cannot read property 'program' of null
67 | function buildVariableAST(graphqlAST, importName) {
68 | const { ast } = transformSync(`var ${importName} = ${JSON.stringify(graphqlAST)}`)
> 69 | return ast.program.body[0]
70 | }
71 | }
72 | }
at buildVariableAST (plugin/index.js:69:22)
at PluginPass.exit (plugin/index.js:30:33)
at newFn (node_modules/@babel/traverse/lib/visitors.js:223:21)
at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:64:19)
at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:38:17)
at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:108:8)
at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:135:18)
at TraversalContext.visitMultiple (node_modules/@babel/traverse/lib/context.js:89:17)
at TraversalContext.visit (node_modules/@babel/traverse/lib/context.js:174:19)
at Function.Object.<anonymous>.traverse.node (node_modules/@babel/traverse/lib/index.js:76:17)
at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:106:18)
at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:135:18)
at TraversalContext.visitSingle (node_modules/@babel/traverse/lib/context.js:94:19)
at TraversalContext.visit (node_modules/@babel/traverse/lib/context.js:176:19)
at Function.Object.<anonymous>.traverse.node (node_modules/@babel/traverse/lib/index.js:76:17)
at traverse (node_modules/@babel/traverse/lib/index.js:46:12)
at transformFile (node_modules/@babel/core/lib/transformation/index.js:108:27)
at runSync (node_modules/@babel/core/lib/transformation/index.js:35:3)
at transformFileSync (node_modules/@babel/core/lib/transform-file-sync.js:29:38)
at transformWithPlugin (tests/util.js:5:10)
at Object.<anonymous> (tests/schema.test.js:6:22)
node v8.9.3
npm v5.7.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
npm install getting Cannot read property 'name' of null error
Hey, try removing npm from dependencies then 1. delete package-lock.json and node module folder 2. run npm install again. – Sakshi Mahajan. Feb ......
Read more >[BUG] Cannot read property 'pickAlgorithm' of null #5496
Current Behavior. Whenever typing an npx function, I receive an error. It seems that NPM, itself, is broken on my device.
Read more >err! cannot read properties of null (reading 'pickalgorithm')
The error "Cannot read property 'pickAlgorithm' of null" usually indicates that there is a problem with the package that you are trying to...
Read more >How to resolve this npm ERR! Cannot read property ...
I have cloned https://github.com/SAP-samples/cap-sflight into BAS and I am trying to build mta but I am getting this following error.
Read more >Cannot read properties of null (reading 'pickAlgorithm')
To solve the NPM error "Cannot read properties of null (reading 'pickAlgorithm')", run the npm cache clear --force and rerun your npm install...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I removed node_modules lock. files and run
npm install
again and it worked, Thanks a lot 😃Glad it worked, thanks for reporting this bug!