Comments (3)
For documentation purposes:
curiosity:require-new gajus$ echo "require('./src')('./src')" | node
module.js:338
throw err;
^
Error: Cannot find module '././src'
at Function.Module._resolveFilename (module.js:336:15)
at Function.require.resolve (module.js:388:19)
at module.exports (/Users/gajus/Documents/dev/gajus/require-new/src/index.js:26:26)
at [stdin]:1:17
at Object.exports.runInThisContext (vm.js:54:17)
at Object.<anonymous> ([stdin]-wrapper:6:22)
at Module._compile (module.js:430:26)
at node.js:567:27
at doNTCallback0 (node.js:408:9)
at process._tickCallback (node.js:337:13)
In the above case:
stackTrace.get()[1].getFileName() [stdin]
and
curiosity:require-new gajus$ node -e "require('./src')('./src')"
module.js:338
throw err;
^
Error: Cannot find module '././src'
at Function.Module._resolveFilename (module.js:336:15)
at Function.require.resolve (module.js:388:19)
at module.exports (/Users/gajus/Documents/dev/gajus/require-new/src/index.js:26:26)
at [eval]:1:17
at Object.exports.runInThisContext (vm.js:54:17)
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:430:26)
at node.js:567:27
at doNTCallback0 (node.js:408:9)
at process._tickCallback (node.js:337:13)
is:
stackTrace.get()[1].getFileName() [eval]
from require-new.
With this in mind, I have updated the code to use process.cwd()
whenever "stdin" or "eval" is the stack origin.
from require-new.
@4368baed3c199c8284103a8842896d1d717e6720
from require-new.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from require-new.