Module parse failed: Identifier directly after number
See original GitHub issueHi,
when I add the line const Client = require('ssh2-sftp-client')
my React project doesn’t compile anymore and I get this error message:
./node_modules/ssh2/lib/protocol/keyParser.js 169:61
Module parse failed: Identifier directly after number (169:61)
You may need an appropriate loader to handle this file type.
| return function genOpenSSLRSAPriv(n, e, d, iqmp, p, q) {
| var bn_d = bigIntFromBuffer(d);
> var dmp1 = bigIntToBuffer(bn_d % (bigIntFromBuffer(p) - 1n));
| var dmq1 = bigIntToBuffer(bn_d % (bigIntFromBuffer(q) - 1n));
| return makePEM('RSA PRIVATE', genRSAASN1Buf(n, e, d, p, q, dmp1, dmq1, iqmp));
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
React app "Module parse failed: Identifier directly after number"
I went through the node_modules folder to look at the source code of the module and tracked the issue to line 399, not...
Read more >Why I can build my react app but cannot start it - Stack Overflow
For me, it was underscores within number literals. ... raised this same error ("Module parse failed: Identifier directly after number").
Read more >SyntaxError: identifier starts immediately after numeric literal
The JavaScript exception "identifier starts immediately after numeric literal" occurs when an identifier started with a digit. Identifiers can only start with ...
Read more >Module parse failed: Identifier 'e' has already been declared
Solved: I'm building a reusable component. The component uses @arcgis/core along with other ui. I'm able to install and use my library in ......
Read more >Module parse failed: Identifier '_alt' has already been declared
Module parse failed : Identifier '_alt' has already been declared (9997:17). You may need an appropriate loader to handle this file type, ...
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
If you are getting the exact same error message as the OP, then it is almost certainly a local configuration issue relating to react. As stated above, the error relating to cpu-features is most often a warning and not an error and won’t impact functionality (it is an optional dependency that is not needed). The other errors reported by the OP seem to have been from something react does which impacts on ssh2. To get this resolved, you will need to create an ssh2 only script which reproduces the error and then report it, together with the script, to the ssh2 project. There is nothing I can do from the ssh2-sftp-client level.
It should be noted that the ssh2 module sees a lot of downloads every week. The ssh2-sftp-client sees a lot less, but even it gets around 250,000 downloads per week. This is only the second report of this issue which I have not been able to reproduce. Therefore, very likely this is an issue being caused by something very local to your environment. This means you will need to track down the local cause in order to have any chance of the issue being resolved as it has to be reproducible first.
I had the same problem with
cpu-features
and the error message was the same when I usedyarn
whilenpm install
worked without errors. node: 16.15.0 “ssh2”: “^1.11.0” windows 10