Npm start is not relative to root


I am a new to web development.
Atom 1.20.1
npm version 3.10.10
node version 6.9.1
webpack version 3.6.0
running npm start from terminal terminal produce the following error:
./src/components/Init.js Module not found: Can’t resolve ‘helpers/localProfile’ in 'C:\Users…\project\src\components’
The error is obvious its try to pick up a file according to current file path BUT ‘helpers/localProfile’ is in different directory.
I can fix it by adding ‘…/’ to the import but then I will need to change it in the whole project.
If I run npm start in windows shell everything works as expected.
I tried several solutions like setting NODE_PATH = src/ in the.env file but it didn’t work. and (rootpath)
I believe it related to Atom as I tried several terminal plugins and all of them produce the same error.
I will really appreciate your help regarding this issue.


Could you post a screenshot of your workspace?


Thanks a lot.
Project Structure:

Error Description:(Unfortunately I can put only one image )

Module not found: Can’t resolve ‘helpers/localProfile’ in ‘C:\Users\Michael\Documents\dogiz2\src\components’

Init file(beginning):
import React from 'react';
import { connect } from 'react-redux';
import { getLocalProfile } from 'helpers/localProfile';
import { profile } from 'actions/user';
import { authState } from 'actions/app';

class Init extends React.Component {
    componentDidMount() {
        let {setInitUser} = this.props;

    render() {
        let {children} = this.props;

        return (
            <div style={{minWidth : "1000px", height : "100%", minHeight : "100%"}}>


If you’re in the same directory in the terminal, I don’t know why it would have different results.


As you can see the error … and the error is obvious . It simply looks for the files relative to the directory it was called from. whele npm start
from windows CLI works as expected…


Can I see your terminal window?


npm start from windows (works as expected):


Sorry my bad executed it from another directory (but it doesn’t change the result just made several tests).


if I makecreate-react-app and thennpm start everything is working as expected.
My case is slightly different I do the create-react-app than I delete all the content and clone repository into that folder.
The images i provided are from cloned repository (of-course that repository was also created with create-react-app so it should work as it works on windows)


What about the Atom terminal?


npm start


after few seconds:


Everything else seems to be happening correctly.


its a question?


ok, I solved the problem:
npm install -D cross-env
"start": "cross-env NODE_PATH=src npm-run-all -p watch-css start-js",
Somehow .env didn’t functioned as well … strange…or maybe junior mistakes.
Thanks a lot DamnedScholar